private void btnPrintInvoice_Click(object sender, EventArgs e) { new Class6().method_4(this.Lbl_TransCode.Text, ref Class6.string_2, ref Class6.string_1, ref Class7.string_1, ref Class6.string_3, ref Class6.string_4, ref Class6.object_0); Class6.transNum = this.Lbl_TransNum.Text.Trim(); Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); Class7.CreateReportInstance(Class6.string_4).ShowPreviewDialog(); }
private void btn_Save_Click(object sender, EventArgs e) { if (this.Lbl_ImpName.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o nơi nhập h\x00e0ng", 1); this.Txt_ImpID.Focus(); } else if (this.Lbl_ExpName.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o nơi xuất h\x00e0ng", 1); this.Txt_ExpID.Focus(); } else if (this.TransDetail.RowCount == 0) { this.Txt_GoodsId.Focus(); } else { string str2 = this.Txt_TransNum.Text.Trim(); this.Txt_ExpID.Text.Trim(); this.Txt_ImpID.Text.Trim(); this.Txt_Remark.Text.Trim(); this.Txt_Voucher.Text.Trim(); if (this.TransDetail.RowCount != 0) { Class6 class2 = new Class6(); string str = Class11.string_0; if (str != null) { if (!(str == "N")) { if (str == "E") { this.btn_Skip_Click(this, new EventArgs()); class2.method_10(str2); this.method_5(str2); class2.method_13(str2); this.method_3(); this.method_6(); this.method_4(); } } else { this.btn_Skip_Click(this, new EventArgs()); class2.ComputeTransnum("K"); this.method_3(); this.method_6(); this.method_4(); } } Class6.transNum = str2; Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); Class7.CreateReportInstance(Class6.string_4).ShowPreviewDialog(); } } }
private void btn_Save_Click(object sender, EventArgs e) { if (this.Lbl_ExpName.Text == string.Empty) { this.Txt_ExpID.Focus(); } else if (this.TransDetail.RowCount == 0) { this.Txt_GoodsId.Focus(); } else { string str2 = this.Txt_TransNum.Text.Trim(); string str3 = this.Txt_ExpID.Text.Trim(); string str5 = this.Txt_Remark.Text.Trim(); string str4 = string.Empty; if (this.TransDetail.RowCount != 0) { Class6 class2 = new Class6(); string str = Class11.string_0; if (str != null) { if (!(str == "N")) { if (str == "E") { this.btn_Skip_Click(this, new EventArgs()); class2.method_10(str2); class2.method_13(str2); class2.method_6(this.string_1, str2, this.string_2, str3, "", str4, str5, this.string_3); class2.method_9(str2, str3); } } else { this.btn_Skip_Click(this, new EventArgs()); class2.ComputeTransnum("K"); string str6 = Class7.smethod_53(); class2.method_6(this.string_1, str2, this.string_2, str3, "", str4, str5, str6); class2.method_9(str2, str3); } } Class6.transNum = str2; Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); } } }
private void btn_Save_Click(object sender, EventArgs e) { if (this.Lbl_StockName.Text == string.Empty) { this.Txt_StockId.Focus(); } else if (this.TransDetail.RowCount != 0) { string str5 = Class7.smethod_19(); string str4 = DateTime.Now.ToString("HH:mm"); string str3 = this.Txt_TransNum.Text.Trim(); string str2 = this.Txt_StockId.Text.Trim(); string str = this.Txt_Remark.Text.Trim(); Class6 class2 = new Class6(); string str6 = Class11.string_0; if (str6 != null) { if (!(str6 == "N")) { if (str6 == "E") { this.bool_0 = false; this.btn_Skip_Click(this, new EventArgs()); this.method_4(); class2.method_13(str3); this.method_3(); this.method_2(); } } else { this.bool_0 = true; this.btn_Skip_Click(this, new EventArgs()); class2.ComputeTransnum("K"); this.method_3(); this.method_2(); } } Class6.string_8 = str; Class6.string_9 = str2; Class6.transNum = str3; Class6.string_6 = str4; Class6.string_7 = str5; Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); } }
private void btn_Save_Click(object sender, EventArgs e) { DataSet set; if (DateTime.Parse(Class7.smethod_19()).Subtract(DateTime.ParseExact(this.Txt_TranDate.Text, "dd/MM/yyyy", null)).TotalDays < 0.0) { Class7.ShowMessageBox("Ng\x00e0y hiệu lực kh\x00f4ng thể chọn trong tương lai", 1); this.Txt_TranDate.Focus(); return; } if (this.Txt_Voucher.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o số chứng từ", 1); this.Txt_Voucher.Focus(); return; } if (this.Txt_Remark.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o diễn giải giao dịch", 1); this.Txt_Remark.Focus(); return; } if (Class7.ParseDoubleValue(this.Txt_Amount.Text) <= 0.0) { Class7.ShowMessageBox("Số tiền kh\x00f4ng hợp lệ", 1); this.Txt_Amount.Focus(); return; } string str3 = string.Format("{0:MM/dd/yyyy}", this.Txt_TranDate.EditValue); string str4 = this.Txt_Voucher.Text.Trim(); string str5 = this.Txt_DbAccId.EditValue.ToString(); double num = Class7.ParseDoubleValue(this.Txt_Amount.Text); double num2 = Class7.ParseDoubleValue(this.Txt_Amount.Text); string str6 = this.Txt_CreAccId.EditValue.ToString(); string str7 = this.Txt_Remark.Text.Trim(); string str8 = this.Txt_Name.Text.Trim(); string str9 = this.Txt_Address.Text.Trim(); string str10 = this.Txt_PsId.Text.Trim(); string str2 = this.Txt_TransNum.Text.Trim(); string str = this.string_0; switch (str) { case null: goto Label_0610; case "N": break; default: { if (!(str == "E")) { goto Label_0610; } if (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn kh\x00f4ng ?", 2) != 1) { return; } this.RrqIxZxw5(this, new EventArgs()); this.string_1 = "select account_id, db_amount, cr_amount from tblAccTrans where trans_num = '" + this.Txt_TransNum.Text.Trim() + "'"; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_1, this.oleDbConnection_0); using (DataTable table = new DataTable()) { this.oleDbDataAdapter_0.Fill(table); foreach (DataRow row in table.Rows) { this.string_1 = string.Concat(new object[] { "update tblAccount set debamt = debamt - ", row["db_amount"], ",creamt = creamt - ", row["db_amount"], " where account_id = '", row["account_id"], "'" }); this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_1, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); continue; } } } this.string_1 = "delete from tblAccTrans where trans_num = '" + this.Txt_TransNum.Text.Trim() + "'"; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_1, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); } Class12.smethod_3(str2, str3, str4, str5, num, 0.0, str6, str7, 1); Class12.smethod_2(str5, num, true); Class12.smethod_3(str2, str3, str4, str6, 0.0, num2, str5, str7, 2); Class12.smethod_2(str6, num2, false); this.string_1 = "update tblAccTrans set name = N'" + str8 + "', address = N'" + str9 + "', person_id = '" + str10 + "', voucher = '" + str4 + "' where trans_num = '" + this.Txt_TransNum.Text.Trim() + "'"; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_1, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); goto Label_0610; } } } this.RrqIxZxw5(this, new EventArgs()); Class12.smethod_3(str2, str3, str4, str5, num, 0.0, str6, str7, 1); Class12.smethod_2(str5, num, true); Class12.smethod_3(str2, str3, str4, str6, 0.0, num2, str5, str7, 2); Class12.smethod_2(str6, num2, false); this.string_1 = "update tblAccTrans set name = N'" + str8 + "', address = N'" + str9 + "', person_id = '" + str10 + "' where trans_num = '" + this.Txt_TransNum.Text.Trim() + "'"; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_1, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); } new Class6().ComputeTransnum("A"); Label_0610: Class6.transNum = this.Txt_TransNum.Text.Trim(); Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); }
private void btn_Save_Click(object sender, EventArgs e) { DataSet set; if (DateTime.Parse(Class7.smethod_19()).Subtract(DateTime.ParseExact(this.Txt_TranDate.Text, "dd/MM/yyyy", null)).TotalDays < 0.0) { Class7.ShowMessageBox("Ng\x00e0y hiệu lực kh\x00f4ng thể chọn trong tương lai", 1); this.Txt_TranDate.Focus(); return; } if (this.Txt_Voucher.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o số chứng từ", 1); this.Txt_Voucher.Focus(); return; } if (this.Txt_Remark.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o diễn giải giao dịch", 1); this.Txt_Remark.Focus(); return; } if (Class7.ParseDoubleValue(this.Txt_Amount.Text) <= 0.0) { Class7.ShowMessageBox("Số tiền kh\x00f4ng hợp lệ", 1); this.Txt_Amount.Focus(); return; } string str = string.Format("{0:MM/dd/yyyy}", this.Txt_TranDate.EditValue); string str2 = this.Txt_Voucher.Text.Trim(); string str3 = this.Txt_DbAccId.EditValue.ToString(); double num = Class7.ParseDoubleValue(this.Txt_Amount.Text); double num2 = Class7.ParseDoubleValue(this.Txt_Amount.Text); string str4 = this.Txt_CreAccId.EditValue.ToString(); string str5 = this.Txt_Remark.Text.Trim(); string str6 = this.Txt_Payer.Text.Trim(); string str7 = this.Txt_PayAccId.Text.Trim(); string str8 = this.Txt_PayerBank.Text.Trim(); string str9 = this.Txt_PayerBranch.Text.Trim(); string str10 = this.Txt_Beneficiary.Text.Trim(); string str11 = this.Txt_BenAccId.Text.Trim(); string str12 = this.Txt_BenBank.Text.Trim(); string str13 = this.Txt_BenBranch.Text.Trim(); double num3 = Class7.ParseDoubleValue(this.Txt_Amount.Text); string str14 = this.Txt_TransNum.Text.Trim(); string str15 = this.IjSwogAv6; switch (str15) { case null: goto Label_0740; case "N": break; default: { if (!(str15 == "E")) { goto Label_0740; } if (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn kh\x00f4ng ?", 2) != 1) { return; } this.iWyIskLbe(this, new EventArgs()); this.string_0 = "select account_id, db_amount, cr_amount from tblAccTrans where trans_num = '" + this.Txt_TransNum.Text.Trim() + "'"; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_0, this.oleDbConnection_0); using (DataTable table = new DataTable()) { this.oleDbDataAdapter_0.Fill(table); foreach (DataRow row in table.Rows) { this.string_0 = string.Concat(new object[] { "update tblAccount set debamt = debamt - ", row["db_amount"], ",creamt = creamt - ", row["db_amount"], " where account_id = '", row["account_id"], "'" }); this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_0, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); continue; } } } this.string_0 = "delete from tblAccTrans where trans_num = '" + this.Txt_TransNum.Text.Trim() + "'"; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_0, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); } Class12.smethod_3(str14, str, str2, str3, num, 0.0, str4, str5, 1); Class12.smethod_2(str3, num, true); Class12.smethod_3(str14, str, str2, str4, 0.0, num2, str3, str5, 2); Class12.smethod_2(str4, num2, false); this.string_0 = string.Concat(new object[] { "UPDATE tblPaymentOrder SET payer =N'", str6, "', payer_acc ='", str7, "', payer_bank =N'", str8, "', payer_branch =N'", str9, "', benef =N'", str10, "', benef_acc ='", str11, "',benef_bank =N'", str12, "', benef_branch =N'", str13, "', amount = ", num3, " WHERE trans_num = '", this.Txt_TransNum.Text.Trim(), "' " }); this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_0, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); goto Label_0740; } } } this.iWyIskLbe(this, new EventArgs()); Class12.smethod_3(str14, str, str2, str3, num, 0.0, str4, str5, 1); Class12.smethod_2(str3, num, true); Class12.smethod_3(str14, str, str2, str4, 0.0, num2, str3, str5, 2); Class12.smethod_2(str4, num2, false); this.string_0 = string.Concat(new object[] { "INSERT INTO tblPaymentOrder (trans_num, payer, payer_acc, payer_bank, payer_branch, benef, benef_acc, benef_bank, benef_branch, amount) VALUES ('", this.Txt_TransNum.Text.Trim(), "',N'", str6, "','", str7, "',N'", str8, "',N'", str9, "',N'", str10, "','", str11, "',N'", str12, "',N'", str13, "',", num3, ") " }); this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_0, this.oleDbConnection_0); using (set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); } new Class6().ComputeTransnum("A"); Label_0740: Class6.transNum = this.Txt_TransNum.Text.Trim(); Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); }
public void method_26() { new FrmGetDates().ShowDialog(); if (Class7.IsInputDate) { DataSet set; DataSet set2; DateTime time2 = Class7.dateTimeFrom; DateTime time3 = Class7.dateTimeTo; string str6 = string.Format("{0:00}", time2.Month) + time2.Year.ToString(); string str = "STKGL_" + smethod_0(SystemInformation.ComputerName); try { oleDbDataAdapter_0 = new OleDbDataAdapter("CREATE TABLE " + str + "([id] [nvarchar](5) DEFAULT (''),[grp_id] [nvarchar](3) DEFAULT (''),[goods_id] [nvarchar](6) DEFAULT (''),[Name] [nvarchar](80) DEFAULT (''),[begin_qty] [decimal](18, 2) DEFAULT ((0)),[begin_amt] [decimal](18, 2) DEFAULT ((0)),[imP_qty] [decimal](18, 2) DEFAULT ((0)),[imp_amt] [decimal](18, 2) DEFAULT ((0)),[exp_qty] [decimal](18, 2) DEFAULT ((0)),[exp_amt] [decimal](18, 2) DEFAULT ((0)),[end_qty] [decimal](18, 2) DEFAULT ((0)),[end_amt] [decimal](18, 2) DEFAULT ((0)))", oleDbConnection_0); using (set = new DataSet()) { oleDbDataAdapter_0.Fill(set); } oleDbConnection_0.Close(); } catch (Exception) { oleDbDataAdapter_0 = new OleDbDataAdapter("DELETE FROM " + str, oleDbConnection_0); using (set = new DataSet()) { oleDbDataAdapter_0.Fill(set); } oleDbConnection_0.Close(); } string str3 = string.Empty; string str4 = string.Empty; oleDbDataAdapter_0 = new OleDbDataAdapter("select id from tblStore where type in('01','02') and status = 1", oleDbConnection_0); DataTable dataTable = new DataTable(); oleDbDataAdapter_0.Fill(dataTable); oleDbConnection_0.Close(); foreach (DataRow row in dataTable.Rows) { str4 = str4 + "'" + row["id"].ToString() + "',"; } str3 = "(" + str4.Substring(0, str4.Length - 1) + ")"; oleDbDataAdapter_0 = new OleDbDataAdapter(string.Concat(new object[] { "SELECT stk.tran_date, stk.exp_id, stk.imp_id, stk.goods_id, stk.qty, stk.unit_symb, stk.amount, stk.vat_amt, stk.surplus, stk.Status, gs.full_name,gs.status AS gsstt FROM tblTransaction AS stk INNER JOIN tblGoods AS gs ON stk.goods_id = gs.goods_id WHERE (gs.status = 1) AND (stk.Status = 1) AND (stk.tran_date between '", time2, "' and '", time3, "') " }), oleDbConnection_0); DataTable table2 = new DataTable(); oleDbDataAdapter_0.Fill(table2); oleDbConnection_0.Close(); foreach (DataRow row in table2.Rows) { if (str3.Contains(row["imp_id"].ToString())) { oleDbDataAdapter_0 = new OleDbDataAdapter(string.Concat(new object[] { "if not exists (select * from ", str, " where id = '", row["imp_id"], "' and goods_id = '", row["goods_id"], "') insert into ", str, "(id, goods_id, name, imp_qty, imp_amt) values('", row["imp_id"], "', '", row["goods_id"], "',N'", row["full_name"], "',", row["qty"], ",", row["amount"], ") Else update ", str, " set imp_qty = imp_qty + ", row["qty"], ", imp_amt = imp_amt + ", row["amount"], " where id = '", row["imp_id"], "' and goods_id = '", row["goods_id"], "'" }), oleDbConnection_0); set = new DataSet(); oleDbDataAdapter_0.Fill(set); oleDbConnection_0.Close(); } if (str3.Contains(row["exp_id"].ToString())) { oleDbDataAdapter_0 = new OleDbDataAdapter(string.Concat(new object[] { "if not exists (select * from ", str, " where id = '", row["exp_id"], "' and goods_id = '", row["goods_id"], "') insert into ", str, "(id, goods_id, name, exp_qty, exp_amt) values('", row["exp_id"], "', '", row["goods_id"], "',N'", row["full_name"], "',", row["qty"], ",", row["amount"], ") Else update ", str, " set exp_qty = exp_qty + ", row["qty"], ", exp_amt = exp_amt + ", row["amount"], " where id = '", row["exp_id"], "' and goods_id = '", row["goods_id"], "'" }), oleDbConnection_0); set2 = new DataSet(); oleDbDataAdapter_0.Fill(set2); oleDbConnection_0.Close(); } } DateTime time = DateTime.ParseExact(string_13, "dd/MM/yyyy", null); if (((string.Format("{0:00}", time.Day) + string.Format("{0:00}", time.Month)) != str6) && Class7.smethod_28("STKINFO_" + str6)) { oleDbDataAdapter_0 = new OleDbDataAdapter("select * from STKINFO_" + str6, oleDbConnection_0); DataTable table3 = new DataTable(); oleDbDataAdapter_0.Fill(table3); oleDbConnection_0.Close(); foreach (DataRow row in table3.Rows) { oleDbDataAdapter_0 = new OleDbDataAdapter(string.Concat(new object[] { "if not exists (select * from ", str, " where id = '", row["id"], "' and goods_id = '", row["goods_id"], "') insert into ", str, "(id, goods_id, begin_qty, begin_amt) values('", row["id"], "', '", row["goods_id"], "',", row["qty"], ",", row["amount"], ") Else update ", str, " set begin_qty = begin_qty + ", row["qty"], ", begin_amt = begin_amt + ", row["amount"], " where id = '", row["id"], "' and goods_id = '", row["goods_id"], "'" }), oleDbConnection_0); set2 = new DataSet(); oleDbDataAdapter_0.Fill(set2); oleDbConnection_0.Close(); } } Class7.CreateReportInstance("stk_gl").ShowPreviewDialog(); } }
private void kCnalMegv(object sender, EventArgs e) { if (this.Lbl_ImpName.Text == string.Empty) { this.Txt_ImpID.Focus(); } else if (this.Lbl_ExpName.Text == string.Empty) { this.Txt_ExpID.Focus(); } else if (this.TransDetail.RowCount == 0) { this.Txt_GoodsId.Focus(); } else { string str = this.Txt_TransNum.Text.Trim(); string str3 = this.Txt_ExpID.Text.Trim(); string str2 = this.Txt_ImpID.Text.Trim(); this.Txt_Remark.Text.Trim(); this.Txt_Voucher.Text.Trim(); int num1 = this.chk_inclVat.Checked ? 1 : 0; int num2 = this.Chk_includedisc.Checked ? 1 : 0; int num3 = this.Chk_discpervat.Checked ? 1 : 0; this.Cmb_TaxCode.Text.Trim(); if (this.TransDetail.RowCount != 0) { Class6 class2 = new Class6(); string str4 = this.string_3; if (str4 != null) { if (!(str4 == "N")) { if (str4 == "E") { this.bool_0 = false; this.btn_Skip_Click(this, new EventArgs()); class2.method_18(str); class2.method_8(str); class2.method_13(str); this.method_4(); class2.method_17(str); class2.method_7(str, str2); class2.kCnalMegv(this.string_0); class2.method_11(this.string_0, str3); } } else { this.bool_0 = true; this.btn_Skip_Click(this, new EventArgs()); WaitDialogForm form = new WaitDialogForm(); form.Caption = "Xin đợi một ch\x00fat ...."; class2.ComputeTransnum("K"); this.method_4(); class2.method_17(str); class2.method_7(str, str2); class2.kCnalMegv(this.string_0); class2.method_11(this.string_0, str3); this.string_2 = "UPDATE tblOn_order SET status = 0 WHERE trans_num = '" + this.Txt_OrderNumber.Text + "' "; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_2, this.oleDbConnection_0); using (DataSet set = new DataSet()) { this.oleDbDataAdapter_0.Fill(set); this.oleDbConnection_0.Close(); } form.Close(); } } Class6.transNum = str; Class7.CreateReportInstance("v_frsupp").ShowPreviewDialog(); } } }
private void btn_Save_Click(object sender, EventArgs e) { if (this.Lbl_ImpName.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o nơi nhập h\x00e0ng", 1); this.Txt_ImpID.Focus(); } else if (this.Lbl_ExpName.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o nơi xuất h\x00e0ng", 1); this.Txt_ExpID.Focus(); } else if (this.TransDetail.RowCount == 0) { this.Txt_GoodsId.Focus(); } else { string str2 = this.Txt_TransNum.Text.Trim(); string str4 = this.Txt_ExpID.Text.Trim(); string str3 = this.Txt_ImpID.Text.Trim(); this.Txt_Remark.Text.Trim(); this.Txt_Voucher.Text.Trim(); int num1 = this.chk_inclVat.Checked ? 1 : 0; int num2 = this.Chk_includedisc.Checked ? 1 : 0; int num3 = this.Chk_discpervat.Checked ? 1 : 0; this.CgeIdZyqWF.Text.Trim(); if (this.TransDetail.RowCount != 0) { Class6 class2 = new Class6(); string str5 = this.string_3; if (str5 != null) { if (!(str5 == "N")) { if (str5 == "E") { this.iWyIskLbe(this, new EventArgs()); class2.method_18(str2); class2.method_8(str2); class2.method_13(str2); this.method_4(); class2.method_17(str2); class2.method_7(str2, str3); class2.kCnalMegv(this.string_0); class2.method_11(this.string_0, str4); } } else { this.iWyIskLbe(this, new EventArgs()); class2.ComputeTransnum("K"); this.method_4(); class2.method_17(str2); class2.method_7(str2, str3); class2.kCnalMegv(this.string_0); class2.method_11(this.string_0, str4); } } if (this.chkLabelPrn.Checked) { this.oleDbDataAdapter_0 = new OleDbDataAdapter("DELETE FROM tblLABELS", this.oleDbConnection_0); DataSet dataSet = new DataSet(); this.oleDbDataAdapter_0.Fill(dataSet); this.oleDbConnection_0.Close(); string selectCommandText = "SELECT A.goods_id, A.full_name, A.grp_id,A.piceunit, A.merc_type, B.rtprice, C.trans_num,C.qty, C.exp_id,C.imp_id, C.recnum FROM tblGoods AS A INNER JOIN tblPrice AS B ON A.goods_id = B.goods_id INNER JOIN tblTransaction AS C ON A.goods_id = C.goods_id where C.trans_num = '" + str2 + "' "; this.oleDbDataAdapter_0 = new OleDbDataAdapter(selectCommandText, Class7.oleDbConnection_1); DataTable dataTable = new DataTable(); this.oleDbDataAdapter_0.Fill(dataTable); Class7.oleDbConnection_1.Close(); foreach (DataRow row in dataTable.Rows) { selectCommandText = "INSERT INTO tblLABELS([idx],[timeinput],[goods_id],[fullname],[shortname],[grp_id],[supp_id],[rtprice],[qty],user_id) "; object obj2 = selectCommandText; obj2 = string.Concat(new object[] { obj2, "VALUES(", row["recnum"], ",'", row["recnum"].ToString(), "','", row["goods_id"], "','", row["full_name"], "','", row["full_name"], "'," }); OleDbDataAdapter adapter = new OleDbDataAdapter(string.Concat(new object[] { obj2, "'", row["grp_id"], "','", row["exp_id"], "','", row["rtprice"], "',", row["qty"], ",", Class7.GetUserId(), ")" }), this.oleDbConnection_0); using (DataSet set = new DataSet()) { adapter.Fill(set); } this.oleDbConnection_0.Close(); } } Class6.transNum = str2; Class7.CreateReportInstance("v_frsupp").ShowPreviewDialog(); } } }
private void btn_Save_Click(object sender, EventArgs e) { if (DateTime.Parse(Class7.smethod_19()).Subtract(DateTime.ParseExact(this.Txt_TranDate.Text, "dd/MM/yyyy", null)).TotalDays < 0.0) { Class7.ShowMessageBox("Ng\x00e0y hiệu lực kh\x00f4ng thể chọn trong tương lai", 1); this.Txt_TranDate.Focus(); } else if (this.Txt_Voucher.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o số chứng từ", 1); this.Txt_Voucher.Focus(); } else if (this.Txt_Remark.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o diễn giải giao dịch", 1); this.Txt_Remark.Focus(); } else if (Class7.ParseDoubleValue(this.Txt_CreAmt1.Text) <= 0.0) { Class7.ShowMessageBox("Số tiền kh\x00f4ng hợp lệ", 1); this.Txt_CreAmt1.Focus(); } else if (this.Lbl_DebAccName.Text == string.Empty) { Class7.ShowMessageBox("T\x00e0i khoản ghi nợ kh\x00f4ng hợp lệ", 1); this.Txt_DebAccId.Focus(); } else { string str = this.string_0; if ((str != null) && (str == "N")) { this.btn_Skip_Click(this, new EventArgs()); string str3 = string.Format("{0:MM/dd/yyyy}", this.Txt_TranDate.EditValue); string str4 = this.Txt_Voucher.Text.Trim(); string str5 = this.Txt_DebAccId.EditValue.ToString(); double num2 = Class7.ParseDoubleValue(this.Txt_CreAmt1.Text); double num3 = Class7.ParseDoubleValue(this.Txt_CreAmt2.Text); double num = Class7.ParseDoubleValue(this.Txt_CreAmt3.Text); string str6 = this.Txt_Remark.Text.Trim(); string str2 = this.Txt_TransNum.Text.Trim(); Class12.smethod_3(str2, str3, str4, str5, num2, 0.0, this.Txt_CreAccId1.EditValue.ToString(), str6, 2); Class12.smethod_3(str2, str3, str4, this.Txt_CreAccId1.EditValue.ToString(), 0.0, num2, str5, str6, 1); if ((num3 > 0.0) && (this.Lbl_CreAccName2.Text != string.Empty)) { Class12.smethod_3(str2, str3, str4, str5, num3, 0.0, this.Txt_CreAccId2.EditValue.ToString(), str6, 4); Class12.smethod_3(str2, str3, str4, this.Txt_CreAccId2.EditValue.ToString(), 0.0, num3, str5, str6, 3); } if ((num > 0.0) && (this.Lbl_CreAccName3.Text != string.Empty)) { Class12.smethod_3(str2, str3, str4, str5, num, 0.0, this.Txt_CreAccId2.EditValue.ToString(), str6, 6); Class12.smethod_3(str2, str3, str4, this.Txt_CreAccId2.EditValue.ToString(), 0.0, num, str5, str6, 5); } Class12.smethod_2(this.Txt_CreAccId1.EditValue.ToString(), num2, false); Class12.smethod_2(this.Txt_CreAccId2.EditValue.ToString(), num3, false); Class12.smethod_2(this.Txt_CreAccId3.EditValue.ToString(), num, false); Class12.smethod_2(this.Txt_DebAccId.EditValue.ToString(), Class7.ParseDoubleValue(this.Lbl_DebitAmt.Text), true); new Class6().ComputeTransnum("A"); } Class6.transNum = this.Txt_TransNum.Text.Trim(); Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); } }
private void btn_Save_Click(object sender, EventArgs e) { if (this.Lbl_ImpName.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o nơi nhập h\x00e0ng", 1); this.Txt_ImpID.Focus(); } else if (this.Lbl_ExpName.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o nơi xuất h\x00e0ng", 1); this.Txt_ExpID.Focus(); } else if (this.TransDetail.RowCount == 0) { this.Txt_GoodsId.Focus(); } else { string str = this.Txt_TransNum.Text.Trim(); string str3 = this.Txt_ExpID.Text.Trim(); string str4 = this.Txt_ImpID.Text.Trim(); string str6 = this.Txt_Remark.Text.Trim(); string str5 = string.Empty; if (this.TransDetail.RowCount != 0) { Class6 class2 = new Class6(); WaitDialogForm form = new WaitDialogForm(); form.Caption = "Xin chờ một ch\x00fat ...."; string str7 = Class11.string_0; if (str7 != null) { if (!(str7 == "N")) { if (str7 == "E") { this.iWyIskLbe(this, new EventArgs()); class2.method_18(str); this.IjSwogAv6(); this.method_4(); this.method_2(); this.method_3(); class2.method_13(str); class2.method_6(this.string_1, str, this.string_4, str3, str4, str5, str6, this.string_3); } } else { this.iWyIskLbe(this, new EventArgs()); class2.ComputeTransnum("K"); string str8 = Class7.smethod_53(); class2.method_6(this.string_1, str, this.string_4, str3, str4, str5, str6, str8); class2.method_17(str); this.method_3(); this.method_2(); } } if (this.chkLabelPrn.Checked) { this.oleDbDataAdapter_0 = new OleDbDataAdapter("DELETE FROM tblLABELS", this.oleDbConnection_1); DataSet dataSet = new DataSet(); this.oleDbDataAdapter_0.Fill(dataSet); this.oleDbConnection_1.Close(); string selectCommandText = "SELECT A.goods_id, A.full_name, A.grp_id,A.piceunit, A.merc_type, B.rtprice, C.trans_num,C.qty, C.exp_id,C.imp_id, C.recnum FROM tblGoods AS A INNER JOIN tblPrice AS B ON A.goods_id = B.goods_id INNER JOIN tblTransaction AS C ON A.goods_id = C.goods_id where C.trans_num = '" + str + "' "; this.oleDbDataAdapter_0 = new OleDbDataAdapter(selectCommandText, Class7.oleDbConnection_1); DataTable dataTable = new DataTable(); this.oleDbDataAdapter_0.Fill(dataTable); Class7.oleDbConnection_1.Close(); foreach (DataRow row in dataTable.Rows) { selectCommandText = "INSERT INTO tblLABELS([idx],[timeinput],[goods_id],[fullname],[shortname],[grp_id],[supp_id],[rtprice],[qty],user_id) "; object obj2 = selectCommandText; obj2 = string.Concat(new object[] { obj2, "VALUES(", row["recnum"], ",'", row["recnum"].ToString(), "','", row["goods_id"], "','", row["full_name"], "','", row["full_name"], "'," }); OleDbDataAdapter adapter = new OleDbDataAdapter(string.Concat(new object[] { obj2, "'", row["grp_id"], "','", row["exp_id"], "','", row["rtprice"], "',", row["qty"], ",", Class7.GetUserId(), ")" }), this.oleDbConnection_1); using (DataSet set2 = new DataSet()) { adapter.Fill(set2); } this.oleDbConnection_1.Close(); } } form.Close(); Class6.transNum = str; Class7.CreateReportInstance("v_mercmove").ShowPreviewDialog(); Class7.CreateReportInstance("v_mercmove1").ShowPreviewDialog(); } } }
private void btn_Save_Click(object sender, EventArgs e) { if (this.Txt_Voucher.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o số chứng từ", 1); this.Txt_Voucher.Focus(); } else if (this.Lbl_DbAccName.Text == string.Empty) { Class7.ShowMessageBox("Số t\x00e0i khoản kh\x00f4ng hợp lệ", 1); this.Txt_Account.Focus(); } else if (this.Txt_Remark.Text == string.Empty) { Class7.ShowMessageBox("Bạn chưa khai b\x00e1o diễn giải giao dịch", 1); this.Txt_Remark.Focus(); } else if (DateTime.Parse(Class7.smethod_19()).Subtract(DateTime.ParseExact(this.Txt_TranDate.Text, "dd/MM/yyyy", null)).TotalDays < 0.0) { Class7.ShowMessageBox("Ng\x00e0y hiệu lực kh\x00f4ng thể chọn trong tương lai", 1); this.Txt_TranDate.Focus(); } else { string str2 = string.Format("{0:MM/dd/yyyy}", this.Txt_TranDate.EditValue); string str3 = this.Txt_Voucher.Text.Trim(); string str4 = this.Txt_Account.EditValue.ToString(); double num = Class7.ParseDoubleValue(this.Txt_Amount.Text); double num2 = 0.0; string str5 = string.Empty; string str6 = this.Txt_Remark.Text.Trim(); string str = this.Txt_TransNum.Text.Trim(); int num3 = 1; if (num <= 0.0) { Class7.ShowMessageBox("Số tiền kh\x00f4ng hợp lệ", 1); this.Txt_Amount.Focus(); } else { string str7 = this.string_1; if (str7 != null) { if (!(str7 == "N")) { if (str7 == "E") { if (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn kh\x00f4ng ?", 2) != 1) { return; } this.btn_Skip_Click(this, new EventArgs()); Class12.smethod_5(str4, this.Txt_TransNum.Text.Trim(), num, str6, true); Class12.smethod_4(str4, this.double_0, true); Class12.smethod_2(str4, num, true); } } else { this.btn_Skip_Click(this, new EventArgs()); Class12.smethod_3(str, str2, str3, str4, num, num2, str5, str6, num3); new Class6().ComputeTransnum("A"); Class12.smethod_2(str4, num, true); } } Class6.transNum = this.Txt_TransNum.Text.Trim(); Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); } } }
private void btn_Save_Click(object sender, EventArgs e) { string str7; string str = this.Txt_TransNum.Text.Trim(); string str2 = this.Txt_OldTrans.Text.Trim(); string str3 = this.Txt_ExpID.Text.Trim(); string str4 = this.Txt_ImpID.Text.Trim(); string str5 = this.Txt_Remark.Text.Trim(); string str6 = this.Txt_Voucher.Text.Trim(); if (this.TransDetail.RowCount == 0) { return; } Class6 class2 = new Class6(); if (!class2.method_22()) { this.string_4 = "select goods_id, imp_id, qty from tblTransaction where trans_num = '" + str2 + "'"; this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_4, this.oleDbConnection_1); using (DataTable table = new DataTable()) { this.oleDbDataAdapter_0.Fill(table); this.oleDbConnection_1.Close(); IEnumerator enumerator = table.Rows.GetEnumerator(); while (enumerator.MoveNext()) { DataRow current = (DataRow)enumerator.Current; if (class2.method_21(current["goods_id"].ToString(), current["imp_id"].ToString()) < Class7.smethod_2(current["qty"])) { goto Label_0149; } } goto Label_0183; Label_0149: Class7.ShowMessageBox("Số lượng tồn kh\x00f4ng đủ để xuất kho !", 1); return; } } Label_0183: str7 = Class11.string_0; if (str7 != null) { if (!(str7 == "N")) { if (str7 == "E") { this.btn_Skip_Click(this, new EventArgs()); class2.method_20(str); class2.method_10(str); class2.method_13(str); class2.method_6(this.string_0, str, this.string_1, str3, str4, str6, str5, this.string_3); class2.method_9(str, str3); } } else { this.btn_Skip_Click(this, new EventArgs()); class2.ComputeTransnum("K"); this.ddvqeXfa4(this.string_0, str, this.string_1, str3, str4, str6, str5); class2.method_19(str); class2.method_9(str, str3); } } Class6.transNum = str; Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog(); }