Esempio n. 1
0
 private void btnCreateTrans_Click(object sender, EventArgs e)
 {
     if (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn tạo giao dịch đặt h\x00e0ng n\x00e0y kh\x00f4ng ?", 2) == 1)
     {
         Class6 class2 = new Class6();
         string str    = class2.method_5("H");
         string str2   = DateTime.ParseExact(this.Txt_DtDelivery.Text, "dd/MM/yyyy", null).ToString();
         string str3   = Class7.smethod_53();
         string str4   = (this.Txt_Remark.Text == string.Empty) ? "Đặt h\x00e0ng từ nh\x00e0 cung cấp" : this.Txt_Remark.Text;
         string str5   = this.Txt_ExpID.Text.Trim();
         if (this.Lbl_ExpName.Text == string.Empty)
         {
             Class7.ShowMessageBox("Bạn chưa chọn m\x00e3 nh\x00e0 cung cấp", 1);
             this.Txt_ExpID.Focus();
         }
         else
         {
             using (WaitDialogForm form = new WaitDialogForm())
             {
                 form.Caption            = "Tạo giao dịch số " + str;
                 this.oleDbDataAdapter_0 = new OleDbDataAdapter("select  goods_id,unitsymb, Name, qty, price,end_qty  from " + this.string_0, this.oleDbConnection_0);
                 using (DataTable table = new DataTable())
                 {
                     this.oleDbDataAdapter_0.Fill(table);
                     this.oleDbConnection_0.Close();
                     foreach (DataRow row in table.Rows)
                     {
                         this.string_2 = string.Concat(new object[] {
                             "INSERT INTO tblOn_order (tran_date, tran_time, deliver_dt, trans_num, trans_code, exp_id, goods_id, qty, unit_symb, price, merc_type, user_id, remark,status,end_qty) VALUES     ('", Class7.smethod_19(), "','", str3, "','", str2, "','", str, "','30','", str5, "','", row["goods_id"], "',", row["qty"], ",'", row["unitsymb"],
                             "',", row["price"], ",'01',", Class7.GetUserId(), ",N'", str4, "',1,", row["end_qty"], ") "
                         });
                         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();
                             continue;
                         }
                     }
                 }
                 this.oleDbDataAdapter_0 = new OleDbDataAdapter("DELETE FROM " + this.string_0, this.oleDbConnection_0);
                 using (DataSet set2 = new DataSet())
                 {
                     this.oleDbDataAdapter_0.Fill(set2);
                     this.oleDbConnection_0.Close();
                 }
                 form.Close();
                 this.Txt_GoodsId.Text  = string.Empty;
                 this.Txt_ExpID.Text    = string.Empty;
                 this.Txt_ExpID.Enabled = true;
                 this.Lbl_ExpName.Text  = string.Empty;
                 this.Lbl_MercName.Text = string.Empty;
                 class2.ComputeTransnum("H");
                 Class6.transNum = str;
                 this.method_0();
                 this.Txt_ExpID.Focus();
             }
         }
     }
 }
Esempio n. 2
0
        private void btn_Correct_Click(object sender, EventArgs e)
        {
            if (this.GridView1.RowCount != 0)
            {
                if (this.Lbl_StockName.Text == string.Empty)
                {
                    Class7.ShowMessageBox("Bạn chưa chọn m\x00e3 kho, quầy !", 1);
                    this.Txt_StockId.Focus();
                }
                else if (Class7.ShowMessageBox("Bạn c\x00f3 chắc chắn hiệu chỉnh kh\x00f4ng ?", 2) == 1)
                {
                    Class6         class2 = new Class6();
                    string         str5   = class2.method_5("K");
                    WaitDialogForm form   = new WaitDialogForm();
                    form.Caption = "Tạo giao dịch " + str5;

                    this.oleDbDataAdapter_0 = new OleDbDataAdapter("select tblAdjust.*, tblgoods.piceunit from tblAdjust inner join tblgoods on tblAdjust.goods_id = tblgoods.goods_id where tblAdjust.real_qty <> 0 ", this.oleDbConnection_0);
                    DataTable dataTable = new DataTable();
                    this.oleDbDataAdapter_0.Fill(dataTable);
                    this.oleDbConnection_0.Close();
                    if (dataTable.Rows.Count == 0)
                    {
                        Class7.ShowMessageBox("Kh\x00f4ng c\x00f3 sự ch\x00eanh lệch, kh\x00f4ng cần hiệu chỉnh !", 1);
                        form.Close();
                    }
                    else
                    {
                        string str  = Class7.smethod_19();
                        string str2 = Class7.smethod_53();
                        string str3 = this.Txt_StockId.Text.Trim();
                        string str4 = "Giao dịch c\x00e2n đối kiểm k\x00ea tự động";
                        int    num  = 1;
                        foreach (DataRow row in dataTable.Rows)
                        {
                            string str6 = (Class7.ParseDoubleValue(row["real_qty"].ToString()) > 0.0) ? "" : str3;
                            string str7 = (Class7.ParseDoubleValue(row["real_qty"].ToString()) < 0.0) ? "" : str3;
                            double num2 = Math.Abs(Class7.ParseDoubleValue(row["real_qty"].ToString()));
                            double num3 = num2 * Class7.ParseDoubleValue(row["averimppr"].ToString());
                            string selectCommandText = string.Concat(new object[] {
                                "INSERT INTO tblTransaction(tran_date, tran_time, trans_num, trans_code, voucher, invoice, post, exp_id, imp_id,goods_id, qty, unit_symb, amount, discount, vat_amt, surplus, commis_amt, user_id,cs_id,remark, updated, merc_type, tax_code, vat_incl, discpervat, disc_incl, copies, recnum, Status) VALUES('", str, "','", str2, "','", str5, "','", this.string_0, "','','',0,'", str6, "','", str7, "','", row["goods_id"], "',", num2,
                                ",'", row["piceunit"], "',", num3, ",0,0,0,0, ", Class7.GetUserId(), ",'',N'", str4, "',0,'01','',0,0,0,0,", num, ",1)"
                            });
                            this.oleDbDataAdapter_0 = new OleDbDataAdapter(selectCommandText, this.oleDbConnection_0);
                            using (DataSet set = new DataSet())
                            {
                                this.oleDbDataAdapter_0.Fill(set);
                                this.oleDbConnection_0.Close();
                            }
                            num++;
                        }
                        class2.ComputeTransnum("K");
                        form.Caption = "Tạo giao dịch " + str5;
                        this.method_2();
                        Class7.ShowMessageBox("Hiệu chỉnh dữ liệu th\x00e0nh c\x00f4ng !", 1);
                        form.Close();
                    }
                }
            }
        }
Esempio n. 3
0
        private void btn_New_Click(object sender, EventArgs e)
        {
            Class11.smethod_8(this);
            Class11.smethod_5(this, "T");
            Class11.smethod_1(this);
            Class6 class2 = new Class6();

            this.Txt_TranDate.Text = Class7.smethod_19();
            this.Txt_TransNum.Text = class2.method_5("A");
            this.string_0          = "N";
        }
Esempio n. 4
0
        private void btn_New_Click(object sender, EventArgs e)
        {
            this.method_0();
            this.method_1();
            Class11.smethod_1(this);
            Class11.smethod_5(this, "T");
            Class6 class2 = new Class6();

            this.Txt_Price.Enabled = false;
            this.Txt_TransNum.Text = class2.method_5("K");
            this.Txt_ExpID.Focus();
        }
Esempio n. 5
0
        private void btn_New_Click(object sender, EventArgs e)
        {
            Class6 class2 = new Class6();

            this.Txt_OldTrans.Enabled = true;
            this.Txt_Qty.Enabled      = false;
            this.btn_New.Enabled      = false;
            this.btn_Save.Enabled     = true;
            this.btn_Skip.Enabled     = true;
            this.Txt_TransNum.Text    = class2.method_5("P");
            this.Txt_OldTrans.Focus();
        }
Esempio n. 6
0
        private void btn_New_Click(object sender, EventArgs e)
        {
            Class11.smethod_8(this);
            Class11.smethod_5(this, "T");
            Class11.smethod_1(this);
            Class6 class2 = new Class6();

            this.Txt_TranDate.Text = Class7.smethod_19();
            this.Txt_TransNum.Text = class2.method_5("A");
            this.string_0          = "N";
            if (Class6.string_2 == "81")
            {
                this.Txt_Voucher.Text = "CK" + string.Format("{0:000}", this.method_0(Class6.string_2) + 1);
            }
        }
Esempio n. 7
0
        private void btn_New_Click(object sender, EventArgs e)
        {
            Class11.smethod_8(this);
            Class11.smethod_5(this, "T");
            Class11.smethod_1(this);
            Class6 class2 = new Class6();

            this.Txt_TranDate.Text    = Class7.smethod_19();
            this.Txt_TransNum.Text    = class2.method_5("A");
            this.IjSwogAv6            = "N";
            this.Txt_Payer.Text       = "Cty CP TM&DV Ohayo mart VN";
            this.Txt_PayAccId.Text    = "11522358042013";
            this.Txt_PayerBank.Text   = "Techcombank - CN Ba Đ\x00ecnh";
            this.Txt_PayerBranch.Text = "132-138 Kim M\x00e3, TP.H\x00e0 Nội";
            this.Txt_CreAccId.Text    = "1121";
        }
Esempio n. 8
0
        private void btn_New_Click(object sender, EventArgs e)
        {
            Class6 class2 = new Class6();

            this.Txt_Barcode.Enabled = true;
            this.Txt_Qty.Enabled     = true;
            this.Txt_Rtprice.Enabled = false;
            this.method_0();
            this.btn_New.Enabled  = false;
            this.btn_Save.Enabled = true;
            this.method_1();
            this.Txt_TransNum.Text = class2.method_5("P");
            this.string_2          = "N";
            this.btnSuspend.Text   = "F12-Ho\x00e3n";
            this.btn_Skip.Enabled  = false;
            this.Txt_Barcode.Focus();
        }