/// <summary> /// The example below shows how to Select the RoleId and CreatedBy columns for use with a with a Drop Down List, Combo Box, Checked Box List, List View, List Box, etc /// </summary> private void SelectRoleMasterDropDownListData() { List <RoleMaster> objRoleMasterCol = RoleMaster.SelectRoleMasterDropDownListData(); // Example 1: directly bind to a drop down list - for ASP.NET Web Forms // DropDownList ddl1 = new DropDownList(); // ddl1.DataValueField = "RoleId"; // ddl1.DataTextField = "CreatedBy"; // ddl1.DataSource = objRoleMasterCol; // ddl1.DataBind(); // Example 2: add each item through a loop - for ASP.NET Web Forms // DropDownList ddl2 = new DropDownList(); // foreach (RoleMaster objRoleMaster in objRoleMasterCol) // { // ddl2.Items.Add(new ListItem(objRoleMaster.CreatedBy, objRoleMaster.RoleId.ToString())); // } // Example 3: bind to a combo box. for Windows Forms (WinForms) // ComboBox cbx1 = new ComboBox(); // foreach (RoleMaster objRoleMaster in objRoleMasterCol) // { // cbx1.Items.Add(new ListItem(objRoleMaster.CreatedBy, objRoleMaster.RoleId.ToString())); // } }
private PageResult LoadPage(string returnUrl) { // create the model used by the partial page AddEditUserRolesPartialModel model = new AddEditUserRolesPartialModel(); model.UserMasterDropDownListData = UserMaster.SelectUserMasterDropDownListData(); model.RoleMasterDropDownListData = RoleMaster.SelectRoleMasterDropDownListData(); model.Operation = CrudOperation.Add; model.ReturnUrl = returnUrl; // assign values to the model used by this page PartialModel = model; // assign the return url ReturnUrl = returnUrl; return(Page()); }
public PageResult LoadPage(int id, string returnUrl) { // select a record by primary key(s) CourseEnquiry1API.BusinessObject.UserRoles objUserRoles = UserRoles.SelectByPrimaryKey(id); // create the model used by the partial page AddEditUserRolesPartialModel model = new AddEditUserRolesPartialModel(); model.UserMasterDropDownListData = UserMaster.SelectUserMasterDropDownListData(); model.RoleMasterDropDownListData = RoleMaster.SelectRoleMasterDropDownListData(); model.Operation = CrudOperation.Update; model.ReturnUrl = returnUrl; model.UserRoles = objUserRoles; // assign values to the model used by this page PartialModel = model; // assign the return url ReturnUrl = returnUrl; return(Page()); }
/// <summary> /// Sets data needed on page intialization. /// </summary> private void SetData() { UserRoles = new fifth_tempDBAPI.BusinessObject.UserRoles(); UserMasterDropDownListData = UserMaster.SelectUserMasterDropDownListData(); RoleMasterDropDownListData = RoleMaster.SelectRoleMasterDropDownListData(); }
/// <summary> /// Initial handler the razor page encounters. /// </summary> public void OnGet() { UserMasterDropDownListData = UserMaster.SelectUserMasterDropDownListData(); RoleMasterDropDownListData = RoleMaster.SelectRoleMasterDropDownListData(); }
/// <summary> /// Sets data needed on page intialization. /// </summary> private void SetData() { UserRoles = new CourseEnquiry1API.BusinessObject.UserRoles(); UserMasterDropDownListData = UserMaster.SelectUserMasterDropDownListData(); RoleMasterDropDownListData = RoleMaster.SelectRoleMasterDropDownListData(); }
/// <summary> /// Sets data needed on page intialization. /// </summary> private void SetData() { UserRoles = new TemporaryDBappllicationAPI.BusinessObject.UserRoles(); UserMasterDropDownListData = UserMaster.SelectUserMasterDropDownListData(); RoleMasterDropDownListData = RoleMaster.SelectRoleMasterDropDownListData(); }