/// <summary> /// Handler, deletes a record. /// </summary> public IActionResult OnGetRemove(int id) { LoginTable LoginTable = LoginTable.SelectByPrimaryKey(id); LoginTable.Delete(id); return(new JsonResult(true)); }
/// <summary> /// Used when adding or updating a record. /// </summary> internal static void AddOrEdit(LoginTable model, CrudOperation operation, bool isForListInline = false) { LoginTable objLoginTable; LoginTable objLoginTableOld = new LoginTable(); decimal id = 0; if (operation == CrudOperation.Add) { objLoginTable = new LoginTable(); } else { objLoginTable = LoginTable.SelectByPrimaryKey(model.Adminid); objLoginTableOld = objLoginTable.ShallowCopy(); } objLoginTable.Adminid = model.Adminid; objLoginTable.Password = model.Password; if (operation == CrudOperation.Add) { id = objLoginTable.Insert(); } else { objLoginTable.Update(); } }
public void LoadPage(int id, string returnUrl) { // select a record by primary key(s) StudentEnquiryAPI.BusinessObject.LoginTable objLoginTable = LoginTable.SelectByPrimaryKey(id); // assign values to this page's bound property LoginTable = objLoginTable; // assign the return url ReturnUrl = returnUrl; }
/// <summary> /// Shows how to Select a record by Primary Key. It also shows how to retrieve Lazily-loaded related Objects. Related Objects are assigned for each Foreign Key. /// </summary> private void SelectByPrimaryKey() { int adminidSample = 12; // select a record by primary key(s) LoginTable objLoginTable = LoginTable.SelectByPrimaryKey(adminidSample); if (objLoginTable != null) { // if record is found, a record is returned int adminid = objLoginTable.Adminid; string password = objLoginTable.Password; } }
public PageResult LoadPage(int id, string returnUrl) { // select a record by primary key(s) StudentEnquiryAPI.BusinessObject.LoginTable objLoginTable = LoginTable.SelectByPrimaryKey(id); // create the model used by the partial page AddEditLoginTablePartialModel model = new AddEditLoginTablePartialModel(); model.Operation = CrudOperation.Update; model.ReturnUrl = returnUrl; model.LoginTable = objLoginTable; // assign values to the model used by this page PartialModel = model; // assign the return url ReturnUrl = returnUrl; return(Page()); }