Ejemplo n.º 1
0
 private void tsmiUpdate_Click(object sender, EventArgs e)
 {
     if (CusSelectForm.ThisForm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
     {
         bool   isUpdate = new Express.BLL.OrderInfo().UpdateOrderCusInfo(Convert.ToInt32(CusSelectForm.ThisForm.Tag), " id in(" + SeletedValues + ")");
         string msg      = isUpdate ? "修改信息成功!":"修改信息失败!";
         MessageBox.Show(msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         LoadData();
     }
 }
Ejemplo n.º 2
0
 public RemarkForm(int id)
 {
     InitializeComponent();
     btnSave.Tag = id.ToString();
     Express.Model.OrderInfo info = new Express.BLL.OrderInfo().GetModel(id);
     if (null != info)
     {
         textBox1.Text = info.Paream2;//显示备注信息
     }
 }
Ejemplo n.º 3
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (null != btnSave.Tag)
     {
         int id = int.Parse(btnSave.Tag.ToString());
         Express.Model.OrderInfo info = new Express.BLL.OrderInfo().GetModel(id);
         info.Paream2 = textBox1.Text;
         new Express.BLL.OrderInfo().Update(info);
         this.DialogResult = System.Windows.Forms.DialogResult.OK;
     }
 }
Ejemplo n.º 4
0
 private void tsmiDel_Click(object sender, EventArgs e)
 {
     if (gvInfo.SelectedCells.Count < 1)
     {
         return;
     }
     if (MessageBox.Show("确认要删除当前选中的单号吗?", "系统提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
     {
         bool   issuc = new Express.BLL.OrderInfo().DeleteList(SeletedValues);
         string msg   = issuc ? "删除信息成功!" : "删除信息失败!";
         MessageBox.Show(msg, "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
         LoadPage();
         LoadData();
     }
 }
Ejemplo n.º 5
0
        public MsgForm(int id)
        {
            InitializeComponent();
            Express.Model.OrderInfo model = new Express.BLL.OrderInfo().GetModel(id);
            if (model != null)
            {
                string filename = model.Id + ".html";
                Write(filename, model.Paream3);

                string url = Application.StartupPath + @"\datamsg\" + filename;
                if (File.Exists(url))
                {
                    webBrowser1.Url = new Uri(url);
                }
            }
        }
Ejemplo n.º 6
0
 private void RefreshClient()
 {
     if (!this.InvokeRequired)
     {
         pbInfo.Value++;
         if (pbInfo.Value == pbInfo.Maximum)
         {
             bool sucess = new Express.BLL.OrderInfo().AddByGroup(Import_dtInfo);
             MessageBox.Show("导入数据完成!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             btnImport.Enabled = true;
         }
     }
     else
     {
         this.Invoke(new RefreshProcess(RefreshClient));
     }
 }
Ejemplo n.º 7
0
        private void ProcessData()
        {
            Import_dtInfo = new Express.BLL.OrderInfo().GetList(" 0=1").Tables[0];
            for (int i = 0; i < dtImportInfo.Rows.Count; i++)
            {
                ///过滤无用的单号信息
                //if (new Express.BLL.OrderInfo().GetRecordCount(string.Format(" orderno='{0}' and Daterecived=#{1}#", dtImportInfo.Rows[i][0].ToString(),dtReciveDate.Date)) <= 0)
                //{
                if (!string.IsNullOrEmpty(dtImportInfo.Rows[i][0].ToString()) && dtImportInfo.Rows[i][0].ToString().Length > 6)
                {
                    DataRow newrow = Import_dtInfo.NewRow();
                    newrow["OrderNo"]      = dtImportInfo.Rows[i][0].ToString();
                    newrow["CustomerID"]   = cid;
                    newrow["SalesmanID"]   = sid;
                    newrow["Daterecived"]  = dtReciveDate.Date;
                    newrow["Contractdate"] = dtReciveDate.Date;
                    newrow["OperUser"]     = ClientInfo.Sys_UserInfo.username;
                    newrow["UserDate"]     = DateTime.Now;

                    newrow["OState"]  = 0;
                    newrow["ORState"] = 0;
                    Import_dtInfo.Rows.Add(newrow);
                }
                //Express.Model.OrderInfo orderInfo = new Express.Model.OrderInfo();
                //orderInfo.CustomerID = cid;
                //orderInfo.SalesmanID = sid;
                //orderInfo.OrderNo = dtImportInfo.Rows[i][0].ToString();
                //orderInfo.Daterecived = dtReciveDate.Date;
                //orderInfo.Contractdate = orderInfo.Daterecived;
                //orderInfo.OperUser = ClientInfo.Sys_UserInfo.username;
                //orderInfo.UserDate = DateTime.Now;
                //new Express.BLL.OrderInfo().Add(orderInfo);
                //}
                //RefreshClient();
            }
            bool sucess = new Express.BLL.OrderInfo().AddByGroup(Import_dtInfo);

            MessageBox.Show("成功导入数据完成!共导入(" + (dtImportInfo.Rows.Count - 1) + ")票!", "系统提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
            btnImport.Enabled = true;
        }
Ejemplo n.º 8
0
        private OrderInfo ProcessBase(OrderInfo nowOrder, bool isSearch = true)
        {
            try
            {
                string order       = nowOrder.OrderNo;
                string orderInfo   = ""; //订单信息
                string userInfo    = ""; //收件人信息
                string replyInfo   = ""; //留言信息
                string barCodeInfo = ""; //条码扫描信息
                HtmlProcess(order, ref orderInfo, ref userInfo, ref replyInfo, ref barCodeInfo);

                orderInfo   = B64Decode(orderInfo);
                userInfo    = B64Decode(userInfo);
                replyInfo   = B64Decode(replyInfo);
                barCodeInfo = B64Decode(barCodeInfo);

                if (string.IsNullOrEmpty(orderInfo) || !orderInfo.Contains(',') || !orderInfo.Contains(';'))
                {
                    return(null);
                }

                if (!string.IsNullOrEmpty(orderInfo) && orderInfo.Contains(";"))
                {
                    orderInfo = orderInfo.Remove(orderInfo.LastIndexOf(';'));
                }
                if (isSearch)
                {
                    nowOrder = new Express.BLL.OrderInfo().GetModel(nowOrder.Id);
                }

                nowOrder.Provice = GetIndexData(userInfo, 5);
                nowOrder.City    = GetIndexData(userInfo, 6);
                nowOrder.Area    = GetIndexData(userInfo, 7);
                nowOrder.Address = GetIndexData(userInfo, 10);
                nowOrder.Remark  = GetSaleTelphone(orderInfo);
                nowOrder.Reciver = GetIndexData(userInfo, 8);

                nowOrder.OState  = GetOrderState(orderInfo, ref nowOrder);
                nowOrder.ORState = GetRemindState(orderInfo);
                double layoutDays = 0;
                nowOrder.Merchandiser = OrderState(orderInfo, ref layoutDays);
                nowOrder.Paream8      = (int)(layoutDays * 100);
                nowOrder.Paream1      = GetCompCode(orderInfo);//作为揽件扫描编码



                nowOrder.Paream3 = replyInfo;//保存留言信息

                nowOrder.Paream6 = GetReturnState(orderInfo);
                var weight = QuiciGetWeight(orderInfo);
                //if (order.Substring(0, 1).Trim() != "9" && weight > 2)//小包不能大于2公斤
                //{
                //    weight = 0;
                //}
                nowOrder.Paream7 = (int)(weight * 100);

                nowOrder.Paream4 = GetPickPerson(orderInfo);//获取揽件员信息


                nowOrder.Paream0 = GetBarCodeInfo(barCodeInfo, 2);
                if (nowOrder.Paream0.Contains("("))
                {
                    nowOrder.Paream0 = nowOrder.Paream0.Substring(0, nowOrder.Paream0.IndexOf("("));
                }
                nowOrder.Paream9 = GetBarCodeInfo(barCodeInfo, 4);
                if (!string.IsNullOrEmpty(nowOrder.Paream9) && nowOrder.Paream9.Contains(" "))
                {
                    string[] thredInfo = nowOrder.Paream9.Split(' ');
                    nowOrder.Paream10 = thredInfo[0];//三段码信息
                    if (thredInfo.Length > 2)
                    {
                        nowOrder.Paream11 = thredInfo[2];//三段码信息
                    }
                    if (thredInfo.Length > 4)
                    {
                        nowOrder.Paream12 = thredInfo[4];//三段码信息
                    }
                }

                string p13 = GetBarCodeInfo(barCodeInfo, 1);
                if (p13.Contains("("))
                {
                    nowOrder.Paream13 = p13.Substring(0, p13.IndexOf("("));//所属分部
                }
                if (p13.Contains(")"))
                {
                    nowOrder.Paream14 = p13.Substring(p13.IndexOf(")") + 2, 6);//分部编码
                }

                if (!string.IsNullOrEmpty(userInfo) && userInfo.Contains(";"))
                {
                    string[] rowDatas  = userInfo.Split(';');
                    string[] userDatas = rowDatas[rowDatas.Length - 2].Split(',');//取最后一条数据为数据来源
                    if (userDatas.Length > 14)
                    {
                        nowOrder.Paream15 = userDatas[14];//订单来源
                    }
                }

                //20170911取消该功能
                //nowOrder.Paream4 = GetSameCity(orderInfo, ref layoutDays).ToString() + GetJiBaoError(orderInfo, ref layoutDays) + GetDiffFengBu(orderInfo, ref layoutDays) + GetDiffComp(orderInfo, ref layoutDays);

                if (nowOrder.OState > 0 && nowOrder.OState < 3)
                {
                    string[] dts = orderInfo.Split(';');
                    Array.Sort(dts);
                    nowOrder.Contractdate = DateTime.Parse(dts[dts.Length - 1].Split(',')[1].ToString());
                    string reciver    = dts[dts.Length - 1].Split(',')[3].ToString();
                    int    startIndex = reciver.IndexOf(" 由") + 2;
                    int    length     = reciver.LastIndexOf(" 签收。");
                    if (length > startIndex)
                    {
                        nowOrder.Contractor = reciver.Substring(startIndex, length - startIndex);
                    }
                    //取得最后地址
                    int    a           = reciver.IndexOf("到达:") + 3;
                    string lastAddress = a > 2 ? reciver.Substring(a, reciver.IndexOf("(") - a - 2) : "";
                    if (nowOrder.Provice == "无" && nowOrder.Area == "无")
                    {
                        nowOrder.Area    = lastAddress;
                        nowOrder.Address = lastAddress;
                    }
                }
                return(nowOrder);
            }
            catch (Exception ex)
            {
                //throw new Exception(ex.Message);
                return(null);
            }
        }