Esempio n. 1
0
        private void BtnSubmitAddApp_Click(object sender, EventArgs e)
        {
            BaseData.Store store = new BaseData.Store();
            //if (store.SelectStoreInfoByStoreName(txtDeliverStore4.Text).Rows.Count == 0 || store.SelectStoreInfoByStoreName(txtReceiptStore4.Text).Rows.Count == 0)
            //{
            //    MessageBox.Show("收发店铺名错误");
            //}
            if (AddApplicationDT.Rows.Count == 0)
            {
                MessageBox.Show("表中未添加转货内容");
            }
            else if (txtCtrlID.Text == null || txtCtrlID.Text.Length == 0)
            {
                MessageBox.Show("请填写控制单号");
            }
            else
            {
                int       TotalCount   = 0;
                double    TotalPrice   = 0;
                DataTable AddAppInfoDT = applicationInfo.SelectApplicationByCtrlID(applicationInfo.CtrlID);

                AddAppInfoDT.Rows[0]["WuliuID"] = txtWuliuID.Text;
                if (DeliverOrReceipt == "Deliver")
                {
                    AddAppInfoDT.Rows[0]["DeliverDate"] = dtAppDate.Value; AddAppInfoDT.Rows[0]["DeliverCheck"] = txtStoreCheck.Text;
                }
                else
                {
                    AddAppInfoDT.Rows[0]["ReceiptDate"] = dtAppDate.Value; AddAppInfoDT.Rows[0]["ReceiptCheck"] = txtStoreCheck.Text;
                }

                try
                {
                    AddApplicationDT.AcceptChanges();
                    AddAppInfoDT.AcceptChanges();
                    if (DeliverOrReceipt == "Deliver")
                    {
                        applicationDetail.UpdateDeliverDetail(AddApplicationDT);
                        applicationInfo.UpdateApplicationInfo(AddAppInfoDT);
                    }
                    else
                    {
                        applicationDetail.UpdateReceiptDetail(AddApplicationDT);
                        applicationInfo.UpdateApplicationInfo(AddAppInfoDT);
                    }
                    MessageBox.Show("提交成功", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    DialogResult = DialogResult.OK;
                    this.Close();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("提交失败,错误信息:" + ex.Message);
                }
            }
        }
Esempio n. 2
0
 private void btnOneceRecive_Click(object sender, EventArgs e)
 {
     if (applicationInfo.CtrlID != null)
     {
         ApplicationDetail applicationDetail = new ApplicationDetail();
         DataTable         AddApplicationDT  = applicationDetail.SelectDeliverDetailByCtrlID(applicationInfo.CtrlID);
         DataTable         AddAppInfoDT      = applicationInfo.SelectApplicationByCtrlID(applicationInfo.CtrlID);
         applicationDetail.UpdateReceiptDetail(AddApplicationDT);
         applicationInfo.UpdateApplicationInfo(AddAppInfoDT);
         applicationInfo.ReceiptConfirm(applicationInfo.CtrlID, "一键自动收货!", Login.LoginUser, 1);
         SendEmailtoWuliu();
     }
 }
 private void BtnSubmitAddApp_Click(object sender, EventArgs e)
 {
     BaseData.Store store = new BaseData.Store();
     //if (store.SelectStoreInfoByStoreName(txtDeliverStore4.Text).Rows.Count == 0 || store.SelectStoreInfoByStoreName(txtReceiptStore4.Text).Rows.Count == 0)
     //{
     //    MessageBox.Show("收发店铺名错误");
     //}
     if (txtWuliuID.Text.Length < 1 && DeliverOrReceipt == "待发货")
     {
         MessageBox.Show("请填写物流单号");
     }
     else if (AddApplicationDT.Rows.Count == 0)
     {
         MessageBox.Show("申请表中未添加转货内容");
     }
     else if (txtCtrlID.Text == null || txtCtrlID.Text.Length == 0)
     {
         MessageBox.Show("请填写控制单号");
     }
     else
     {
         DataTable AddAppInfoDT = applicationInfo.SelectApplicationByCtrlID(applicationInfo.CtrlID);
         if (AddAppInfoDT.Rows.Count > 0)
         {
             AddAppInfoDT.Rows[0]["WuliuID"] = txtWuliuID.Text;
             if (DeliverOrReceipt == "待发货")
             {
                 AddAppInfoDT.Rows[0]["DeliverDate"] = dtAppDate.Value; AddAppInfoDT.Rows[0]["DeliverCheck"] = txtStoreCheck.Text;
             }
             else if (DeliverOrReceipt == "待收货")
             {
                 AddAppInfoDT.Rows[0]["ReceiptDate"] = dtAppDate.Value; AddAppInfoDT.Rows[0]["ReceiptCheck"] = txtStoreCheck.Text;
             }
         }
         try
         {
             if (DeliverOrReceipt == "待发货")
             {
                 applicationDetail.UpdateDeliverDetail(AddApplicationDT);
                 applicationInfo.UpdateApplicationInfo(AddAppInfoDT);
                 applicationInfo.DeliverConfirm(applicationInfo.CtrlID, txtStoreCheck.Text, Login.LoginUser, 1);
                 Thread thread = new Thread(new ThreadStart(SendEmailtoReceipt));
                 thread.Start();
             }
             else if (DeliverOrReceipt == "待收货")
             {
                 applicationDetail.UpdateReceiptDetail(AddApplicationDT);
                 applicationInfo.UpdateApplicationInfo(AddAppInfoDT);
                 applicationInfo.ReceiptConfirm(applicationInfo.CtrlID, txtStoreCheck.Text, Login.LoginUser, 1);
                 Thread thread = new Thread(new ThreadStart(SendEmailtoWuliu));
                 thread.Start();
             }
             MessageBox.Show("提交成功", "消息", MessageBoxButtons.OK, MessageBoxIcon.Information);
             DialogResult = DialogResult.OK;
             this.Close();
         }
         catch (Exception ex)
         {
             MessageBox.Show("提交失败,错误信息:" + ex.Message);
         }
     }
 }