private void btnCopy_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { mTable = new POS_Expenses(); txtOrderNo.Text = string.Empty; txtOrderNo.Tag = string.Empty; txtExpensTypeCode.Focus(); txtExpensTypeCode.SelectAll(); NewRecord = true; var user = db.Users.FirstOrDefault(c => c.ID == Settings.CurrentUser_ID && c.Branch_ID == Settings.CurrentBranch_ID); lblUserCreate.Text = user.UserName; lblUserCreateDate.Text = DateTime.Now.ToString(); lblUserLastModified.Text = string.Empty; lbllblUserLastModifiedDate.Text = string.Empty; }
private void Retrieve(long id) { mTable = db.POS_Expenses.Find(id); if (mTable == null) { btn_AddNew_ItemClick(null, null); return; } NewRecord = false; ID = mTable.ID; txtOrderNo.Text = mTable.OrderNo.ToString(); txtExpensTypeCode.Focus(); txtExpensTypeCode.Tag = mTable.ExpensesType_ID; var ExpensesType = db.POS_ExpensesTypes.FirstOrDefault(c => c.ID == mTable.ExpensesType_ID && c.Branch_ID == Settings.CurrentBranch_ID); txtExpensTypeCode.Text = ExpensesType.ExpensCode; lblExpensTypeName.Text = ExpensesType.ExpensName; txtAmount.Value = (decimal)mTable.Amount; txtNote.Text = mTable.Note; var user = db.Users.FirstOrDefault(c => c.ID == mTable.UserCreate && c.Branch_ID == Settings.CurrentBranch_ID); lblUserCreate.Text = user.UserName; lblUserCreateDate.Text = mTable.CreationDate.ToString(); user = db.Users.FirstOrDefault(c => c.ID == mTable.UserLastModified && c.Branch_ID == Settings.CurrentBranch_ID); if (user != null) { lblUserLastModified.Text = user.UserName; } else { lblUserLastModified.Text = ""; } lbllblUserLastModifiedDate.Text = mTable.LastModified.ToString(); }
private void btn_AddNew_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { mTable = new POS_Expenses(); NewRecord = true; txtOrderNo.Text = string.Empty; txtOrderNo.Tag = string.Empty; txtExpensTypeCode.Focus(); txtExpensTypeCode.Text = string.Empty; txtExpensTypeCode.Tag = string.Empty; lblExpensTypeName.Text = string.Empty; txtAmount.Value = 0; txtNote.Text = string.Empty; LookUpxpensType.EditValue = null; LookUp.EditValue = null; var user = db.Users.FirstOrDefault(c => c.ID == Settings.CurrentUser_ID && c.Branch_ID == Settings.CurrentBranch_ID); lblUserCreate.Text = user.UserName; lblUserCreateDate.Text = DateTime.Now.ToString(); lblUserLastModified.Text = string.Empty; lbllblUserLastModifiedDate.Text = string.Empty; }