c# - How to pass a class into another class to a codebehind? -


How to pass a square into another class in Codebahind?

When I look in debug and my.categoryObj in the default .aspx page, I can see that the object is in debug. What am I doing wrong?

I know that I can create an object in Default.aspx, but I should be able to call the business logic level and return to the object and then fill the object and pass it back.

Default.aspx

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.UI; Using System.Web.UI.WebControls; Using SC1.Models.OBJ; Using SC1.Models.BLL; Using SC1.Models.DAL; Namespace SC1 (Public Partial Category) Default: System. Web. UI page (safe sender, page alag) (object sender, eventArg E) {// I know that I can do this but I do not want it unless I do not even have it. // Category Category OBJ = new square (); Category BLL myCategoryBLL = New Class BLL (); Object myCategoryObj = myCategoryBLL.CategoryNew (); // How can I work out the code below or what I'm doing wrong MyCategoryObj.Name = "test"; String testing = ""; }}}  

category BLL.cs

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Data; Using System.Data.SqlClient; Using System.configuration; Using SC1.Models.DAL; Using SC1.Models.OBJ; Namespace SC1.Models.BLL {Public class category BLL {// Create a page object category myCategoryObject = new category (); // Create a data excace layer object category DAL myCategoryDAL = new category DAL (); Public category BLL () {} Public Dataset Selection () {Return (myCategoryDAL.Select ()); } Public Object Class New () {return to myCategoryObject; }}}  

Category DAL.cs

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Data; Using System.Data.SqlClient; Using System.configuration; Namespace SC1.Models.DAL {Public class category DAL {public category DAL () {} string connStr = ConfigurationManager.ConnectionStrings ["staceys_cakesConnectionString"]. ConnectionString; // Select all public datasets () {SqlConnection sqlConnection1 = New SqlConnection (); String SqlString = "Select from categories"; SqlDataAdapter da = New SqlDataAdapter (SqlString, connStr); Dataset ds = new dataset (); Da Filled (DS, "Categories"); Return (DS); } // save // ​​insert // update // delete}}  

Category.cs

  Using; Using System.Collections.Generic; Using System.Linq; Using System.Web; Nameshot SC1. Model OBJE {Public category class {public integer class} {Received; Set; } Public Int ParentID {Receive; Set; } Public string name {get; Set; } Public Ink DisplayOrder {get; Set; } Public Bull Active {get; Set; } Public category () {}}}  

change

  Objects myCategoryObj = myCategoryBLL.CategoryNew ()  

to

  category myCategoryObj = myCategoryBLL.CategoryNew ()  
< P> More

Public Object Category New () {return to myCategoryObject; }

to

public category category New () {go to myCategoryObject; }


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -