Пример #1
0
 /// <summary>
 /// 窗体加载时 初始化时钟 并且 打开菜单窗体
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void FrmParent_Load(object sender, EventArgs e)
 {
     if (!Init())
     {
         Application.Exit();
         return;
     }
     LoadLocalData();
     //tmTime_Tick(sender, e);
     tmUpload.Interval = 3000;
     //if (! UCNodeScan._IsCameraActive)
     //    UCNodeScan._IsCameraActive = UnitechDSDll.OpenCamera(pbPreview.Handle, 3, 3, 400, 300, 1024, 768);
     OpenForm(PageState.Main);
     CheckInputPnl(false);
     CustomerServer.AddCustomersCountyId();
     HuadongTmsOrderServer.AddTMSOrderOptAt();
     BaseServer.AddTable_c2lp_optRecord();
     BaseServer.AddTable_c2lp_consignor();
     BaseServer.AddTable_c2lp_storage_scan();
     BaseServer.AddNode_ParentStorageId();
     BaseServer.AddLinkType();
     BaseServer.AddLinkRegex();
     BaseServer.AddConsignorId();
     BaseServer.AddColunmForScanRecord();
     BaseServer.AddColunmForScanRecord1();
     BaseServer.AddColunmForScanRecord2();
 }
Пример #2
0
        /// <summary>
        /// 上传运单号
        /// </summary>
        private static void UploadOrder()
        {
            ResultModelOfboolean           result = new ResultModelOfboolean();
            List <Model_Huadong_Tms_Order> list   = new List <Model_Huadong_Tms_Order>();

            try
            {
                //根据每次查询运单数量为条件查询几条信息
                DataTable dt = HuadongTmsOrderServer.GethuadongTmsOrder(Common._MaxUploadOrderCount);
                if (dt != null && dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        Model_Huadong_Tms_Order huadong = new Model_Huadong_Tms_Order();
                        huadong.Idk__BackingField         = Convert.ToInt32(row["id"]);
                        huadong.RelationIdk__BackingField = row["relationId"].ToString();
                        list.Add(huadong);
                    }
                    //后台接口,上传数据
                    result = Common._PdaServer.UploadHuadongTmsOrder(list.ToArray());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                if (result.Data)
                {
                    HuadongTmsOrderServer.DeleteUploadHuadongTmsOrder(list.Select(l => l.RelationIdk__BackingField).ToList());
                }
            }
        }
Пример #3
0
        /// <summary>
        /// 上传第三方运单号
        /// </summary>
        private static void UploadThirdOrder()
        {
            ResultModelOfint result = new ResultModelOfint();
            //List<Model_Huadong_Tms_Order> list = new List<Model_Huadong_Tms_Order>();
            string msg = string.Empty;
            string err = string.Empty;
            Model_ThirdPartOrder hdOrder = null;

            try
            {
                //根据每次查询运单数量为条件查询几条信息
                DataTable dt = HuadongTmsOrderServer.GethuadongTmsOrder(Common._MaxUploadOrderCount);
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataRow row = dt.Rows[0];
                    hdOrder = new Model_ThirdPartOrder();
                    hdOrder.Idk__BackingField         = Convert.ToInt32(row["id"]);
                    hdOrder.RelationIdk__BackingField = row["relationId"].ToString();
                    hdOrder.OperateAtk__BackingField  = row["OperateAt"].ToString();
                    result = Common._PdaServer.UploadThirdPartyOrder(hdOrder);
                    //foreach (DataRow row in dt.Rows)
                    //{
                    //    Model_Huadong_Tms_Order huadong = new Model_Huadong_Tms_Order();
                    //    huadong.Idk__BackingField = Convert.ToInt32(row["id"]);
                    //    huadong.RelationIdk__BackingField = row["relationId"].ToString();
                    //    list.Add(huadong);
                    //    msg = huadong.RelationIdk__BackingField;
                    //}
                    //FrmParent.ParentForm.SetNewInfo("正在上报第三方运单" + msg + ",请稍候...", null);
                    ////后台接口,上传数据
                    //result = Common._PdaServer.UploadHuadongTmsOrder(list.ToArray());
                }
            }
            catch (Exception ex)
            {
                err = ex.Message;
                throw ex;
            }
            finally
            {
                if (result.Data == 1 || result.Data == 2)
                {
                    HuadongTmsOrderServer.DeleteUploadHuadongTmsOrder(new List <string>()
                    {
                        hdOrder.RelationIdk__BackingField
                    });
                    if (result.Data == 2 && hdOrder != null)
                    {
                        WaybillServer.DeleteThirdNodeByOptAt(hdOrder.RelationIdk__BackingField, hdOrder.OperateAtk__BackingField);
                    }
                }
                else if (string.IsNullOrEmpty(err))
                {
                    err = result.Message;
                }
                err = err == null ? string.Empty : err;
                FrmParent.ParentForm.SetNewInfo(string.Format("{0}{1} {2}", (msg.Length == 0 ? "没有待上报的第三方运单." : "上报第三方运单"), msg, (err.Length == 0 ? (msg.Length == 0 ? "" : "成功") : "失败 " + err)), err.Length == 0);
            }
        }
Пример #4
0
 /// <summary>
 /// 窗体加载时 初始化时钟 并且 打开菜单窗体
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void FrmParent_Load(object sender, EventArgs e)
 {
     //tmTime_Tick(sender, e);
     tmUpload.Interval = 3000;
     if (!UCNodeScan._IsCameraActive)
     {
         UCNodeScan._IsCameraActive = UnitechDSDll.OpenCamera(pbPreview.Handle, 3, 3, 400, 300, 1024, 768);
     }
     OpenForm(PageState.Main);
     CheckInputPnl(false);
     CustomerServer.AddCustomersCountyId();
     HuadongTmsOrderServer.AddTMSOrderOptAt();
 }
Пример #5
0
        public ResultModel <int> GethuadongWaybillVagueCount(string SHIPDETAILID)
        {
            ResultModel <int> result = new ResultModel <int>();

            try
            {
                result.Data = HuadongTmsOrderServer.GethuadongWaybillVagueCounts(SHIPDETAILID);
            }
            catch (Exception ex)
            {
                result.Code    = 1;
                result.Message = ex.Message;
            }
            return(result);
        }
Пример #6
0
        /// <summary>
        /// 模糊查询第三方运单
        /// </summary>
        /// <param name="SHIPDETAILID"></param>
        /// <param name="pageIndexAndCount"></param>
        /// <returns></returns>
        public ResultModel <List <Model_Huadong_Tms_Order> > GetHuadongWaybillVagueQuery(string SHIPDETAILID, string pageIndexAndCount = null)
        {
            ResultModel <List <Model_Huadong_Tms_Order> > result = new ResultModel <List <Model_Huadong_Tms_Order> >();

            try
            {
                result.Data = HuadongTmsOrderServer.GetHuadongWaybillVagueQuerys(SHIPDETAILID, pageIndexAndCount);
            }
            catch (Exception ex)
            {
                result.Code    = 1;
                result.Message = ex.Message;
            }
            return(result);
        }
Пример #7
0
        /// <summary>
        /// 查询华东信息总条数
        /// </summary>
        /// <returns></returns>
        public ResultModel <int> GethuadongTmsOrderCount()
        {
            ResultModel <int> result = new ResultModel <int>();

            try
            {
                result.Data = HuadongTmsOrderServer.GethuadongTmsOrderCount();
            }
            catch (Exception ex)
            {
                result.Code    = 1;
                result.Message = ex.Message;
            }
            return(result);
        }
Пример #8
0
        /// <summary>
        /// 上传第三方运单号
        /// </summary>
        private static void UploadThirdOrder()
        {
            ResultModelOfboolean           result = new ResultModelOfboolean();
            List <Model_Huadong_Tms_Order> list   = new List <Model_Huadong_Tms_Order>();
            string msg = string.Empty;
            string err = string.Empty;

            try
            {
                //根据每次查询运单数量为条件查询几条信息
                DataTable dt = HuadongTmsOrderServer.GethuadongTmsOrder(Common._MaxUploadOrderCount);
                if (dt != null && dt.Rows.Count > 0)
                {
                    foreach (DataRow row in dt.Rows)
                    {
                        Model_Huadong_Tms_Order huadong = new Model_Huadong_Tms_Order();
                        huadong.Idk__BackingField         = Convert.ToInt32(row["id"]);
                        huadong.RelationIdk__BackingField = row["relationId"].ToString();
                        list.Add(huadong);
                        msg = huadong.RelationIdk__BackingField;
                    }
                    FrmParent.ParentForm.SetNewInfo("正在上报第三方运单" + msg + ",请稍候...", null);
                    //后台接口,上传数据
                    result = Common._PdaServer.UploadHuadongTmsOrder(list.ToArray());
                }
            }
            catch (Exception ex)
            {
                err = ex.Message;
                throw ex;
            }
            finally
            {
                if (result.Data)
                {
                    HuadongTmsOrderServer.DeleteUploadHuadongTmsOrder(list.Select(l => l.RelationIdk__BackingField).ToList());
                }
                else if (string.IsNullOrEmpty(err))
                {
                    err = result.Message;
                }
                err = err == null ? string.Empty : err;
                FrmParent.ParentForm.SetNewInfo(string.Format("{0}{1} {2}", (msg.Length == 0 ? "没有待上报的第三方运单." : "上报第三方运单"), msg, (err.Length == 0 ? (msg.Length == 0 ? "" : "成功") : "失败 " + err)), err.Length == 0);
            }
        }
Пример #9
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);
                }
            }
        }
Пример #10
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);
            //    }
            //}
        }