private void Save_Para() { if (CheckValue() == false) { return; } if (oCate == null) { oCate = new Account.Common.Entities.Categories_Info(); } oCate.ID = txtID.Text.Trim(); oCate.Name = txtName.Text; oCate.Account_GL = oSelectedAccountGL; try { if (Program.eButton == Program.Button.New) { Insert_Category(); } else if (Program.eButton == Program.Button.Edit) { Update_Category(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
private void sbtnEdit_Click(object sender, EventArgs e) { Program.eButton = Program.Button.Edit; oCate = oSelectedCate; Enable(true); txtID.Focus(); }
private void sbtnNew_Click(object sender, EventArgs e) { Program.eButton = Program.Button.New; Clear(); Enable(true); oCate = new Account.Common.Entities.Categories_Info(); }
private void Clear() { txt_AccountID.Text = string.Empty; txt_Ref.Text = string.Empty; txt_Name.Text = string.Empty; txt_CustomerID.Text = string.Empty; oSelectedCustomer = null; lookUEdit_Account_GL.EditValue = string.Empty; oSelectedAccountGL = null; lookUEdit_BranchID.EditValue = string.Empty; oSelectedBranch = null; txt_BranchName.Enabled = false; dtOpenDate.DateTime = System.DateTime.Now; dtLastDate.DateTime = System.DateTime.Now; dtApprovedTime.Text = string.Empty; cbo_Approved.SelectedIndex = 0; dtClosedDate.DateTime = System.DateTime.Now; cbo_Closed.SelectedIndex = 0; cbo_Locked.SelectedIndex = 0; cbo_CreditDebit.Text = string.Empty; lookUEdit_Categories.EditValue = string.Empty; oSelectedCate = null; cbo_Ccy.SelectedIndex = 0; txt_UserCreate.Text = Program.CurrentUser.User_ID; txt_bCredit.Text = string.Empty; txt_dCredit.Text = string.Empty; txt_dDebit.Text = string.Empty; txt_qCredit.Text = string.Empty; txt_qDebit.Text = string.Empty; txt_mCredit.Text = string.Empty; txt_mDebit.Text = string.Empty; txt_yCredit.Text = string.Empty; txt_yDebit.Text = string.Empty; txt_AmountBlock.Text = string.Empty; txt_Bal.Text = string.Empty; txt_BalAvai.Text = string.Empty; }
private void sbtnDel_Click(object sender, EventArgs e) { Program.eButton = Program.Button.Del; oCate = oSelectedCate; Delete_Category(); //Enable(true); //txtID.Focus(); }
private void Detail_Channel(Account.Common.Entities.Channel_Info oCurChannel) { txt_Name.Text = oCurChannel.Name; txt_ISOPort.Text = oCurChannel.ISO_Port.ToString(); txt_ServicePort.Text = oCurChannel.Service_Port.ToString(); txt_ListenerHost.Text = oCurChannel.Listener_Host; if (!string.IsNullOrEmpty(oCurChannel.Branch)) { oSelectedBranch = Program.FindBranch(oCurChannel.Branch); if (oSelectedBranch != null) { lookUEditBranchID.EditValue = oSelectedBranch.ID; txt_BranchName.Text = oSelectedBranch.Name; } } txt_UserID.Text = oCurChannel.UserLogin; txt_UserCreate.Text = oCurChannel.User_Create; lookUpEdit_Ccy.EditValue = oCurChannel.Currency_Code; if (oCurChannel.Security == true) { cbo_Security.SelectedIndex = 0; } else { cbo_Security.SelectedIndex = 1; } dtCreatedDate.DateTime = oCurChannel.Create_Date; oSelectedCate = Program.FindCategories(oCurChannel.Categories); if (oSelectedCate != null) { lookUEdit_Categories.EditValue = oSelectedCate.ID; } oSelectedTranCode = Program.FindTranCode(oCurChannel.AddFund_Trancode); if (oSelectedTranCode != null) { lue_AddFund.EditValue = oSelectedTranCode.Code; } oSelectedTranCode = Program.FindTranCode(oCurChannel.Retail_Trancode); if (oSelectedTranCode != null) { lue_Retail.EditValue = oSelectedTranCode.Code; } oSelectedTranCode = Program.FindTranCode(oCurChannel.FundTranfer_Trancode); if (oSelectedTranCode != null) { lue_FundTransfer.EditValue = oSelectedTranCode.Code; } txt_PrivateKey.Text = oCurChannel.Key; txt_Descript.Text = oCurChannel.Descript; dtLastDate.DateTime = oCurChannel.Last_Date; dtCreatedDate.DateTime = oCurChannel.Create_Date; }
private void lookUEdit_Categories_EditValueChanged(object sender, EventArgs e) { if (lookUEdit_Categories.ItemIndex < 0) { lookUEdit_Categories.EditValue = string.Empty; return; } oSelectedCate = Program.lstCategories[lookUEdit_Categories.ItemIndex]; }
private void lookUEdit_Categories_EditValueChanged(object sender, EventArgs e) { if (lookUEdit_Categories.ItemIndex < 0) { lookUEdit_Categories.EditValue = string.Empty; return; } oSelectedCate = Program.lstCategories[lookUEdit_Categories.ItemIndex]; lookUEdit_Account_GL.EditValue = oSelectedCate.Account_GL.Account_ID; cbo_Ccy.Text = oSelectedCate.Account_GL.Ccy; cbo_CreditDebit.Text = oSelectedCate.Account_GL.CreditDebit.ToString(); }
private void Detail_Cate(Account.Common.Entities.Categories_Info oCurCate) { if (gridView1.FocusedRowHandle < 0 || oCurCate == null) { return; } else { txtID.Text = oCurCate.ID; txtName.Text = oCurCate.Name; txt_AccountGL.Text = oCurCate.Account_GL.Account_ID; } }
private void gridView1_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e) { if (gridView1.FocusedRowHandle < 0) { return; } else { string ID = gridView1.GetRowCellValue(gridView1.FocusedRowHandle, gcolID).ToString(); for (int i = 0; i < lstCategory.Count; i++) { if (lstCategory[i].ID == ID) { oSelectedCate = lstCategory[i]; break; } } Detail_Cate(oSelectedCate); } }
private void Detail_Account(Account.Common.Entities.Account_Info oCurAccount) { txt_AccountID.Text = oCurAccount.Account_ID; txt_Ref.Text = oCurAccount.Reference; txt_Name.Text = oCurAccount.Name; oSelectedCustomer = Program.FindCustomer(oCurAccount.Customer_ID); if (oSelectedCustomer != null) { txt_CustomerID.Text = oSelectedCustomer.ID; } oSelectedAccountGL = Program.FindAccount_GL(oCurAccount.Account_GL); if (oSelectedAccountGL != null) { lookUEdit_Account_GL.EditValue = oSelectedAccountGL.Account_ID; lookUEdit_Account_GL.Text = oSelectedAccountGL.Name; } oSelectedBranch = Program.FindBranch(oCurAccount.Branch_ID); if (oSelectedBranch != null) { lookUEdit_BranchID.EditValue = oSelectedBranch.ID; txt_BranchName.Text = oSelectedBranch.Name; } dtOpenDate.EditValue = oCurAccount.Open_Date; dtLastDate.EditValue = oCurAccount.Last_Date; dtApprovedTime.EditValue = oCurAccount.ApprovedTime; if (oCurAccount.Approved == true) { cbo_Approved.SelectedIndex = 0; } else { cbo_Approved.SelectedIndex = 1; } dtClosedDate.EditValue = oCurAccount.Closed_date; if (oCurAccount.Closed == true) { cbo_Closed.SelectedIndex = 0; } else { cbo_Closed.SelectedIndex = 1; } if (oCurAccount.Locked == true) { cbo_Locked.SelectedIndex = 0; } else { cbo_Locked.SelectedIndex = 1; } oSelectedCate = Program.FindCategories(oCurAccount.Categories); if (oSelectedCate != null) { lookUEdit_Categories.EditValue = oSelectedCate.ID; lookUEdit_Categories.Text = oSelectedCate.Name; } txt_UserCreate.Text = oCurAccount.UserCreate; txt_bCredit.EditValue = oCurAccount.b_Credit; for (int i = 0; i < arrAccType.Length; i++) { if (arrAccType[i].ToString() == oCurAccount.CreditDebit.ToString()) { cbo_CreditDebit.SelectedIndex = i; break; } } oSelectedCcy = Program.FindCcy(oCurAccount.Ccy); if (oSelectedCcy != null) { cbo_Ccy.SelectedValue = oSelectedCcy; cbo_Ccy.SelectedValue = oSelectedCcy.Code; } txt_dCredit.EditValue = oCurAccount.d_Credit; txt_dDebit.EditValue = oCurAccount.d_Debit; txt_qCredit.EditValue = oCurAccount.q_Credit; txt_qDebit.EditValue = oCurAccount.q_Debit; txt_mCredit.EditValue = oCurAccount.m_Credit; txt_mDebit.EditValue = oCurAccount.m_Debit; txt_yCredit.EditValue = oCurAccount.y_Credit; txt_yDebit.EditValue = oCurAccount.y_Debit; txt_AmountBlock.EditValue = oCurAccount.Amount_Blocked; txt_Bal.EditValue = oCurAccount.Balance; txt_BalAvai.EditValue = oCurAccount.BalanceAvaiable; if (oCurAccount.Locked == true) { sbtnLocked.Text = "Bỏ khóa"; } else { sbtnLocked.Text = "Khóa"; } }