Пример #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (CheckInput())
            {
                try
                {
                    string number      = txtOrderNumber.Text.Trim();
                    string storageName = Common._StorageName;
                    //添加扫描的运单号到pda数据库
                    HuadongTmsOrderServer.AddhuadongTmsOrder(number, storageName, Common._Destination);

                    MessageBox.Show("添加成功,您可以继续扫描添加!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
                    txtOrderNumber.Text = string.Empty;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message, "创建运单失败", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                }
            }
        }
Пример #2
0
        private void SaveNode()
        {
            bool     result       = false;
            string   exceptionStr = string.Empty;
            string   content      = string.Empty;
            string   number       = txtOrderNumber.Text.Trim();
            DateTime dtNow        = DateTime.Now;

            try
            {
                if (ucConsignors1._SelectConSignor.ConsignorId == -1)
                {
                    try
                    {
                        ucConsignors1.AutoMatchConsignors(ref number);
                    }
                    catch (Exception ex)
                    {
                        exceptionStr = ex.Message;
                        MessageBox.Show(exceptionStr, "请选择供应商", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
                        return;
                    }
                }
                FrmParent.ParentForm.CheckNumber(number, false);
                string storageName = Common._StorageName;
                //添加扫描的运单号到pda数据库
                dtNow  = HuadongTmsOrderServer.AddhuadongTmsOrder(number, storageName, Common._Destination, ucConsignors1._SelectConSignor.ConsignorId, ref content);
                result = true;

                _SaveOkCount++;
                FrmParent.ParentForm.AddSaveOKNumber(_SaveOkCount);
                FrmParent.ParentForm.EndSleep();
            }
            catch (Exception ex)
            {
                exceptionStr = "保存失败";
                if (ex.Message.Contains("重复扫描"))
                {
                    exceptionStr = ex.Message;
                }
            }
            finally
            {
                if (result)
                {
                    FrmParent.ParentForm.AddScanNum(number, false);
                }
                ShowResult(result, true, exceptionStr);
                Common.SaveOptRecord(exceptionStr == string.Empty ? "保存第三方运单成功" : ("保存第三方运单失败," + exceptionStr), content, dtNow, number, ucConsignors1._SelectConSignor.ConsignorId);
                ucConsignors1.SelectedConsignors();
            }

            //if (CheckInput())
            //{
            //    try
            //    {
            //        string number = txtOrderNumber.Text.Trim();
            //        string storageName = Common._StorageName;
            //        //添加扫描的运单号到pda数据库
            //        HuadongTmsOrderServer.AddhuadongTmsOrder(number, storageName);

            //        //MessageBox.Show("添加成功,您可以继续扫描添加!", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1);
            //        txtOrderNumber.Text = string.Empty;
            //    }
            //    catch (Exception ex)
            //    {
            //        MessageBox.Show(ex.Message, "创建运单失败", MessageBoxButtons.OK, MessageBoxIcon.Hand, MessageBoxDefaultButton.Button1);
            //    }
            //}
        }