protected void ASPxGridView_LoginAccount_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { Temp_LoginAccount.Where(x => x.LoginAccountId == Guid.Parse(e.Keys[0].ToString())).FirstOrDefault().Email = e.NewValues["Email"].ToString(); ASPxGridView_LoginAccount.DataSource = Temp_LoginAccount; ASPxGridView_LoginAccount.DataBind(); e.Cancel = true; (sender as ASPxGridView).CancelEdit(); }
protected void ASPxGridView_LoginAccount_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e) { Temp_LoginAccount.Add(new TMPLoginAccount() { LoginAccountId = Guid.NewGuid(), Email = e.NewValues["Email"].ToString() }); ASPxGridView_LoginAccount.DataSource = Temp_LoginAccount; ASPxGridView_LoginAccount.DataBind(); e.Cancel = true; (sender as ASPxGridView).CancelEdit(); }
protected void ASPxGridView_LoginAccount_RowDeleting(object sender, DevExpress.Web.Data.ASPxDataDeletingEventArgs e) { Guid key = Guid.Parse(e.Keys[0].ToString()); var loginAccounts = (from la in session.GetObjectByKey <Person>(PersonId).LoginAccounts where la.LoginAccountId == key select la).FirstOrDefault(); if (loginAccounts != null) { loginAccounts.RowStatus = Constant.ROWSTATUS_DELETED; loginAccounts.Save(); } Temp_LoginAccount.Remove(Temp_LoginAccount.Where(x => x.LoginAccountId == key).FirstOrDefault()); ASPxGridView_LoginAccount.DataSource = Temp_LoginAccount; ASPxGridView_LoginAccount.DataBind(); e.Cancel = true; (sender as ASPxGridView).CancelEdit(); }
public bool PersonEditing_UpdateGUI() { ClearForm(); // Load Person Person person = session.GetObjectByKey <Person>(PersonId); frmPersonEdit.DataSource = person; frmPersonEdit.DataBind(); // load TMP_LOGINACCOUNT var selectedLA = from la in person.LoginAccounts where la.RowStatus > 0 select la; foreach (LoginAccount la in selectedLA) { Temp_LoginAccount.Add(new TMPLoginAccount() { LoginAccountId = la.LoginAccountId, Email = la.Email }); } ASPxGridView_LoginAccount.DataSource = Temp_LoginAccount; ASPxGridView_LoginAccount.DataBind(); // Bind selected Node var selectedDP = from dp in person.DepartmentPersons where dp.RowStatus > 0 select dp; foreach (DepartmentPerson dp in selectedDP) { foreach (TreeListNode node in DepartmentNodes) { if (Guid.Parse(node.Key).Equals(dp.DepartmentId.DepartmentId)) { node.Selected = true; } } } ASPxTreeList_OfDepartment.DataBind(); // UPDATE GUI popup_PersonCreate.ShowOnPageLoad = true; popup_PersonCreate.HeaderText = string.Format("Thông Tin Người Dùng: {0}", person.Name); return(true); }
public bool PersonEditing_CRUD() { Temp_LoginAccount.Clear(); return(true); }