private void btnSave_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to Save Creent Record ", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { AccountType.AccountCreationDataType _Savedata = new AccountType.AccountCreationDataType(); string respond = SetDataToCLass(out _Savedata); if (!MyAccount.ExistAccountCreation(_Savedata.AccountID)) { if (respond == "True") { respond = MyAccount.SaveAccountCreation(_Savedata); if (respond == "True") { MessageBox.Show("Record Saved Successfully", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); LoadExistingAccount(); LoadExtAccountInHiaraky(); InitializeScreen(); } else { MessageBox.Show(respond, "E r r o r", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { MessageBox.Show(respond, "E r r o r", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } else { MessageBox.Show("Account Number Already in the System, Use Update Button to change delatails", "E r r o r", MessageBoxButtons.OK, MessageBoxIcon.Stop); } } }
private void btnCreate_Click(object sender, EventArgs e) { if (MessageBox.Show("Do you want to Create ?", "Create New Ledgers", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes) { progressBar1.Value = 0; progressBar1.Maximum = dgvList.Rows.Count; foreach (DataGridViewRow r in dgvList.Rows) { if (r.Cells["dgv_Select"].Value == "1") { AccountType.AccountCreationDataType _Savedata = new AccountType.AccountCreationDataType(); string respond = ""; respond = SetDataToClass(r, out _Savedata); if (respond == "True") { if (!Myaccount.ExistAccountCreation(_Savedata.AccountID)) { respond = Myaccount.SaveAccountCreation(_Savedata); } if (respond != "True") { Program.VerningMessage(respond); } } } progressBar1.Value = r.Index + 1; } Program.InformationMessage("Account Saved Successfully"); progressBar1.Value = 0; } }
private void btnAdd_Click(object sender, EventArgs e) { if (MyAccount.ExistAccountCreation(lblToID.Text)) { int i = -1; i = ExistInGrid(txtMomo.Text, lblToID.Text); decimal d1 = 0, d2 = 0, lkr = 0, exrt = 0; bool resp = decimal.TryParse(txtLineAmount.Text, out d1); resp = decimal.TryParse(txtVat.Text, out d2); resp = decimal.TryParse(lblExchangerate.Text, out exrt); lkr = d1 * exrt; if (i == -1) { int Ref = dgvAccount.Rows.Count + 1; string[] row1 = { lblToID.Text, txtToAccount.Text, txtMomo.Text, lkr.ToString("#0.00"), d1.ToString("#0.00"), d2.ToString("#0.00"), GetNextLinNumber("dgvAccount_LineRef") }; dgvAccount.Rows.Add(row1); } else { dgvAccount.Rows[i].Cells["dgvAccount_Amount"].Value = lkr.ToString("##0.000"); dgvAccount.Rows[i].Cells["dgvAccount_Fcr"].Value = d1.ToString("##0.000"); dgvAccount.Rows[i].Cells["dgvAccount_VAT"].Value = d2.ToString("##0.000"); } CalTotalAmount(); CleareUpperLine(); MakeDueDate(); } else { Program.VerningMessage("Invalied Account Number"); } }
private void btnAdd_Click(object sender, EventArgs e) { if (MyAccount.ExistAccountCreation(lblToID.Text)) { string AccNo = lblToID.Text; int Lref = 0; bool resp = int.TryParse(lblLRef.Text, out Lref); if (!resp) { Lref = -1; } else { Lref = ExistTable(lblLRef.Text); } decimal LKR = 0; decimal USD1 = 0; decimal ExRate = 0; decimal VAT = 0; bool rsp = decimal.TryParse(txtAmount.Text, out USD1); rsp = decimal.TryParse(txtExRate.Text, out ExRate); rsp = decimal.TryParse(txtVat.Text, out VAT); LKR = USD1 * ExRate; if (Lref != -1) { dgvAccList.Rows[Lref].Cells[0].Value = lblToID.Text; dgvAccList.Rows[Lref].Cells[1].Value = txtToAccount.Text; dgvAccList.Rows[Lref].Cells[2].Value = txtToMemo.Text; dgvAccList.Rows[Lref].Cells[3].Value = txtJobNumber.Text; dgvAccList.Rows[Lref].Cells[4].Value = VAT.ToString("##0.00"); dgvAccList.Rows[Lref].Cells[5].Value = LKR.ToString("##0.00"); dgvAccList.Rows[Lref].Cells[6].Value = USD1.ToString("##0.00"); dgvAccList.Rows[Lref].Cells[7].Value = ExRate.ToString("##0.00"); } else { string[] Oneline = { AccNo, txtToAccount.Text, txtToMemo.Text, txtJobNumber.Text, VAT.ToString("##0.00"), LKR.ToString("#00.00"), USD1.ToString("#00.00"), ExRate.ToString("##0.00"), GetNextLinNumber("dgvAccList_Ref") }; dgvAccList.Rows.Add(Oneline); } CalTotalLine(); ClearUpperLine(); } else { Program.VerningMessage("Invalied Account Number"); } }
private void btnAdd_Click(object sender, EventArgs e) { int i = -1; if (MyAccount.ExistAccountCreation(lblToID.Text)) { int lindex1 = -1; bool rsp4 = int.TryParse(lblDownIndex.Text, out lindex1); if (!rsp4) { lindex1 = -1; } i = ExistInGrid(lindex1); decimal LKR = 0, USD = 0, d2 = 0, Exrate = 0; bool resp = decimal.TryParse(txtLineAmount.Text, out USD); resp = decimal.TryParse(lblExchangerate.Text, out Exrate); LKR = USD * Exrate; resp = decimal.TryParse(txtVat.Text, out d2); if (i == -1) { int Ref = dgvAccount.Rows.Count + 1; string[] row1 = { lblToID.Text, txtToAccount.Text, txtMomo.Text, LKR.ToString("#0.00"), USD.ToString("#0.00"), d2.ToString("#0.00"), GetNextLinNumber("dgvAccount_LineRef") }; dgvAccount.Rows.Add(row1); } else { dgvAccount.Rows[i].Cells["dgvAccount_ID"].Value = lblToID.Text; dgvAccount.Rows[i].Cells["dgvAccount_Name"].Value = txtToAccount.Text; dgvAccount.Rows[i].Cells["dgvAccount_Amount"].Value = LKR.ToString("##0.00"); dgvAccount.Rows[i].Cells["dgvAccount_Memo"].Value = txtMomo.Text; dgvAccount.Rows[i].Cells["dgvAccount_Fcr"].Value = USD.ToString("##0.00"); dgvAccount.Rows[i].Cells["dgvAccount_VAT"].Value = d2.ToString("##0.00"); } CalTotalAmount(); CleareUpperLine(); } else { Program.VerningMessage("Invalied Account"); } }
private void btnAddToList_Click(object sender, EventArgs e) { if (MyAccount.ExistAccountCreation(lblToID.Text)) { int Lref = 0; bool res = int.TryParse(lblLineRef.Text, out Lref); int index1 = ExistGridLine(lblLineRef.Text); decimal exrate = 0; decimal LKRDr = 0, LKRCr = 0, USDDr = 0, USDCr = 0, Vat = 0; bool resp = decimal.TryParse(txtDr.Text, out USDDr); resp = decimal.TryParse(txtCr.Text, out USDCr); resp = decimal.TryParse(txtVat.Text, out Vat); resp = decimal.TryParse(lblExrate.Text, out exrate); LKRDr = USDDr * exrate; LKRCr = USDCr * exrate; if (index1 == -1) { string[] Row1 = { lblToID.Text, txtToAccount.Text, txtMemo.Text, LKRDr.ToString("##0.00"), LKRCr.ToString("##0.00"), USDDr.ToString("##0.00"), USDCr.ToString("##0.00"), Vat.ToString("##0.00"), GetNextLinNumber("dgvJE_Ref") }; dgvJE.Rows.Add(Row1); } else { UpdateGridLine(index1, LKRDr, LKRCr, USDDr, USDCr, Vat); } CalTotalValue(); ClearUpprLine(); } else { Program.VerningMessage("Invalied Account"); } }