Esempio n. 1
0
 private void btn_Delete_Click(object sender, EventArgs e)
 {
     if (this.string_3 == "F")
     {
         string str    = this.Txt_TransNum.Text.Trim();
         string str2   = this.Txt_ImpID.Text.Trim();
         Class6 class2 = new Class6();
         string text   = this.btn_Delete.Text;
         if (text != null)
         {
             if (!(text == "&X\x00f3a"))
             {
                 if ((text == "&Phục hồi") && (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn phục hồi giao dịch n\x00e0y kh\x00f4ng ?", 2) == 1))
                 {
                     class2.method_14("tblTransaction", str, 1);
                     class2.method_17(str);
                     class2.method_7(str, str2);
                     this.btn_Skip_Click(this, new EventArgs());
                 }
             }
             else if (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn x\x00f3a giao dịch n\x00e0y kh\x00f4ng ?", 2) == 1)
             {
                 class2.method_18(str);
                 class2.method_8(str);
                 class2.method_14("tblTransaction", str, 0);
                 this.btn_Skip_Click(this, new EventArgs());
             }
         }
     }
 }
Esempio n. 2
0
        private void btn_Delete_Click(object sender, EventArgs e)
        {
            if (this.string_3 != "F")
            {
                return;
            }
            string str    = this.Txt_TransNum.Text.Trim();
            string str2   = this.cmbImport.Text.Trim();
            Class6 class2 = new Class6();
            string text   = this.btn_Delete.Text;

            if (text == null)
            {
                return;
            }
            if (!(text == "&X\x00f3a"))
            {
                if ((text == "&Phục hồi") && (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn phục hồi giao dịch n\x00e0y kh\x00f4ng ?", 2) == 1))
                {
                    class2.method_14("tblTransaction", str, 1);
                    class2.method_17(str);
                    class2.method_7(str, str2);
                    this.btn_Skip_Click(this, new EventArgs());
                }
                return;
            }
            if (!class2.method_22())
            {
                this.string_2           = "select goods_id, imp_id, qty from tblTransaction where trans_num = '" + str + "'";
                this.oleDbDataAdapter_0 = new OleDbDataAdapter(this.string_2, this.oleDbConnection_0);
                using (DataTable table = new DataTable())
                {
                    this.oleDbDataAdapter_0.Fill(table);
                    this.oleDbConnection_0.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_0174;
                        }
                    }
                    goto Label_01AB;
Label_0174:
                    Class7.ShowMessageBox("Số lượng tồn kh\x00f4ng đủ để x\x00f3a giao dịch n\x00e0y !", 1);
                    return;
                }
            }
Label_01AB:
            if (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn x\x00f3a giao dịch n\x00e0y kh\x00f4ng ?", 2) == 1)
            {
                class2.method_18(str);
                class2.method_8(str);
                class2.method_14("tblTransaction", str, 0);
                this.btn_Skip_Click(this, new EventArgs());
            }
        }
Esempio n. 3
0
 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 str3 = this.Txt_TransNum.Text.Trim();
         string str4 = this.Txt_ExpID.Text.Trim();
         string str5 = this.Txt_ImpID.Text.Trim();
         string str7 = this.Txt_Remark.Text.Trim();
         string str6 = 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_18(str3);
                         class2.method_8(str3);
                         class2.method_13(str3);
                         class2.method_6(this.string_0, str3, this.welftZbha, str4, str5, str6, str7, this.string_2);
                         class2.method_7(str3, str5);
                     }
                 }
                 else
                 {
                     this.btn_Skip_Click(this, new EventArgs());
                     class2.ComputeTransnum("K");
                     string str2 = Class7.smethod_53();
                     class2.method_6(this.string_0, str3, this.welftZbha, str4, str5, str6, str7, str2);
                     class2.method_17(str3);
                     class2.method_7(str3, str5);
                 }
             }
             Class6.transNum = str3;
             Class7.CreateReportInstance(Class6.string_3).ShowPreviewDialog();
         }
     }
 }
Esempio n. 4
0
 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();
         }
     }
 }
Esempio n. 5
0
 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();
         }
     }
 }
Esempio n. 6
0
        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();
                }
            }
        }