Esempio n. 1
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 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)
         {
             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_20(str2);
                         class2.method_10(str2);
                         class2.method_13(str2);
                         class2.method_6(this.string_0, str2, this.string_1, str3, str4, str6, str5, this.string_3);
                         class2.method_9(str2, str3);
                     }
                 }
                 else
                 {
                     this.btn_Skip_Click(this, new EventArgs());
                     class2.ComputeTransnum("K");
                     string str7 = Class7.smethod_53();
                     class2.method_6(this.string_0, str2, this.string_1, str3, str4, str6, str5, str7);
                     class2.method_19(str2);
                     class2.method_9(str2, str3);
                 }
             }
             Class6.transNum = str2;
             v_tosupp sup = new v_tosupp();
             sup.ShowPreviewDialog();
         }
     }
 }
Esempio n. 2
0
 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();
         }
     }
 }
Esempio n. 3
0
    protected override void ServeOverLap(IAsyncResult iasyncResult_0)
    {
        Class6 asyncState = (Class6)iasyncResult_0.AsyncState;

        if (!asyncState.imethod_6())
        {
            try
            {
                int num = asyncState.GetStream().EndRead(iasyncResult_0);
                if (num <= 0)
                {
                    base.OnSomeOneDisconnected(asyncState, DisconnectedType.NetworkInterrupted);
                }
                else
                {
                    if (!(((this.object_0 == null) || this.heHhGnOsoo) || asyncState.imethod_1()) && (asyncState.method_7()[0] != Class41.byte_0))
                    {
                        string str = asyncState.GetIPEndPoint().Address.ToString();
                        if (!this.class38_0.method_1(str))
                        {
                            this.class38_0.method_0(str);
                            base.OnSomeOneDisconnected(asyncState, DisconnectedType.InvalidMessage);
                            return;
                        }
                    }
                    asyncState.method_10(num);
                    base.method_2(asyncState, asyncState.method_7());
                    for (MessageHandler class3 = asyncState.method_11(); class3 != null; class3 = asyncState.method_11())
                    {
                        if (base.imethod_27())
                        {
                            asyncState.imethod_10().method_2();
                            asyncState.imethod_10().method_4(class3);
                        }
                        else
                        {
                            base.OnMessageReceived(asyncState, class3);
                        }
                    }
                    if (asyncState.method_6())
                    {
                        base.OnSomeOneDisconnected(asyncState, DisconnectedType.NetworkInterrupted);
                    }
                    else if (!base.bool_0 && !asyncState.imethod_6())
                    {
                        if (asyncState.method_13())
                        {
                            base.OnSomeOneDisconnected(asyncState, DisconnectedType.InvalidMessage);
                            base.emptyAgileLogger_0.Log("ErrorMessage", string.Format("Source Address:{0} ,MessageInvalidType:{1}", asyncState.GetIPEndPoint(), MessageInvalidType.MessageSizeOverflow), "CJFramework.Engine.Tcp.Server.WebSocketEngine.ServeOverLap", ErrorLevel.Standard);
                            base.OnInvalidMessageReceived(asyncState.GetIPEndPoint(), MessageInvalidType.MessageSizeOverflow);
                        }
                        else
                        {
                            asyncState.GetStream().BeginRead(asyncState.method_7(), asyncState.method_8(), asyncState.method_9(), new AsyncCallback(this.ServeOverLap), asyncState);
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                if ((exception is IOException) || (exception is ObjectDisposedException))
                {
                    base.OnSomeOneDisconnected(asyncState, DisconnectedType.NetworkInterrupted);
                }
                else
                {
                    base.emptyAgileLogger_0.Log(exception, "CJFramework.Engine.Tcp.Server.WebSocketEngine.ServeOverLap", ErrorLevel.High);
                }
            }
        }
    }
Esempio n. 4
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();
                }
            }
        }
Esempio n. 5
0
        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();
        }