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()); }