Пример #1
0
        /// <summary>
        /// 生成货号
        /// </summary>
        /// <param name="lc"></param>
        /// <returns></returns>
        public static Tuple <bool, string> GetGoodNo(ref Model.Model.LC_Customer lc)
        {
            sql = makesql.MakeSelectSql(typeof(Model.Model.LC_Line), "[End]=@End", new SqlParameter[] {
                new SqlParameter("@End", lc.finish)
            });
            ids = db.Read(sql);
            if (!ids.flag)
            {
                Tools.SaveLog.AddLog(ids.errormsg, "获取路线错误");
            }
            if (!ids.ReadIsOk())
            {
                return(new Tuple <bool, string>(false, "没有任何数据!"));
            }

            Model.Model.LC_Line lcl = ids.GetVOList <Model.Model.LC_Line>()[0];

            DateTime starttime = DateTime.Now.ToString("yyyy-MM-dd 00:00:00").ConvertData <DateTime>();
            DateTime endtime   = DateTime.Now.ToString("yyyy-MM-dd 23:59:59").ConvertData <DateTime>();

            //获取当前线路当日总单数
            sql = makesql.MakeCount(nameof(Model.Model.LC_Customer), "finish=@finish and DdTime between @starttime and @endtime", new SqlParameter[] {
                new SqlParameter("@finish", lcl.End),
                new SqlParameter("@starttime", starttime),
                new SqlParameter("@endtime", endtime)
            });
            ids = db.Read(sql);
            if (!ids.flag)
            {
                return(new Tuple <bool, string>(false, ids.errormsg));
            }

            long nowOrderNumber = ids.Count();

            StringBuilder goodbuffer = new StringBuilder();

            goodbuffer.Append(lcl.Lineletter);
            goodbuffer.Append(DateTime.Now.Day.ToString().PadLeft(2, '0'));
            goodbuffer.Append("-");
            goodbuffer.Append(nowOrderNumber);
            goodbuffer.Append("-");
            goodbuffer.Append(lc.Number);
            return(new Tuple <bool, string>(true, goodbuffer.ToString()));
        }
Пример #2
0
 public static Tuple <bool, string> Add(Model.Model.LC_Customer LC_Customer)
 {
     if (LC_Customer.Consignee.StrIsNull())
     {
         return(new Tuple <bool, string>(false, "请填写收货人"));
     }
     if (LC_Customer.logisticsID.Equals(0))
     {
         return(new Tuple <bool, string>(false, "请选择物流!"));
     }
     if (LC_Customer.SHPhone.StrIsNull())
     {
         return(new Tuple <bool, string>(false, "请填写收获人电话!"));
     }
     if (LC_Customer.Destination.Equals(0))
     {
         return(new Tuple <bool, string>(false, "请选择目的地!"));
     }
     if (LC_Customer.freightMode.Equals(0))
     {
         return(new Tuple <bool, string>(false, "请选择付费方式!"));
     }
     if (LC_Customer.GoodName.StrIsNull())
     {
         return(new Tuple <bool, string>(false, "请填写货物名称!"));
     }
     if (LC_Customer.Number.Equals(0))
     {
         return(new Tuple <bool, string>(false, "请填写件数!"));
     }
     if (LC_Customer.GReceivables.Equals(0))
     {
         return(new Tuple <bool, string>(false, "请填写代收款"));
     }
     if (LC_Customer.CarryGood.Equals(0))
     {
         return(new Tuple <bool, string>(false, "请选择提货方式"));
     }
     if (LC_Customer.ReceiptGood.Equals(0))
     {
         return(new Tuple <bool, string>(false, "请选择收货方式!"));
     }
     return(DAL.DAL.LC_Customer.Add(LC_Customer));
 }
Пример #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            var myuservo = GetMyLoginUserVO();
            var lcc      = new Model.Model.LC_Customer()
            {
                OrderID       = Tools.NewGuid.GuidToLongID().ToString(), //订单ID
                Consignor     = GetValue("Consignor"),                   //发货人
                FHPhone       = GetValue("FHPhone"),                     //发货人电话
                Consignee     = GetValue("Consignee"),                   //收货人名称
                logisticsID   = myuservo.uid,                            //物流
                SHPhone       = GetValue("SHPhone"),                     //收货人电话
                Destination   = GetValue <int>("End"),                   //目的地
                Initially     = myuservo.AreaID,                         //出发地
                begins        = myuservo.AreaID,                         //路线开始地
                finish        = GetValue <int>("finish"),                //路线结束地
                beginUID      = myuservo.uid,                            //路线绑定ID
                finishUID     = GetValue("BindLogisticsUid"),
                GoodName      = GetValue("GoodName"),                    //货物名称
                Number        = GetValue <int>("Number"),                //件数
                Freight       = GetValue <decimal>("Freight"),           //运费
                OtherExpenses = GetValue <decimal>("OtherExpenses"),     //其他费用
                GReceivables  = GetValue <decimal>("GReceivables"),      //代收款
                freightMode   = GetValue <int>("freightMode"),           //付款方式
                CarryGood     = GetValue <int>("CarryGood"),             //提货方式
                ReceiptGood   = GetValue <int>("ReceiptGood"),           //收货方式
                DdTime        = DateTime.Now,                            //发货时间
                ConsigneeTime = DateTime.Now,                            //收货时间
                State         = 2,
            };
            //添加
            Tuple <bool, string> vo = DAL.DAL.LC_Customer.AutonomyBilling(lcc, myuservo, true);

            if (vo.Item1)
            {
                //Jump("/LC/MenuBar/LC_BusinessIndex.aspx");
            }
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //获取地区省列表
            shengList   = DAL.DAL.DALBase.GetNextAddressListFromId(1);
            shr         = GetValue("shr");
            shrdh       = GetValue("shrdh");
            mbd         = GetValue("mbd");
            uffs        = GetValue("uffs");
            wlid        = GetValue("wlid");
            CarryGood   = GetValue <int>("CarryGood");
            ReceiptGood = GetValue <int>("ReceiptGood");
            try
            {
                var Ident = GetValue("Ident");
                if (Ident != "1")
                {
                    var    myuservo = GetMyLoginUserVO();
                    string UserName = myuservo.username;
                    string Phone    = myuservo.phones;
                    int    cfd      = myuservo.AreaID;

                    var lcc = new Model.Model.LC_Customer()
                    {
                        OrderID       = Tools.NewGuid.GuidToLongID().ToString(),                                      //订单ID
                        Consignor     = UserName,                                                                     //发货人
                        ConsignorID   = Tools.NewGuid.GuidTo16String(),                                               //发货人ID
                        FHPhone       = Phone,                                                                        //发货人电话
                        Consignee     = GetValue("Consignee"),                                                        //收货人名称
                        logisticsID   = GetValue("logisticsID").StringToArray().GetIndexValue(0),                     //物流
                        SHPhone       = GetValue("SHPhone"),                                                          //收货人电话
                        Destination   = GetValue <int>("End"),                                                        //目的地
                        Initially     = GetValue("logisticsID").StringToArray().GetIndexValue(3).ConvertData <int>(), //出发地
                        GoodName      = GetValue("GoodName"),                                                         //货物名称
                        Number        = GetValue <int>("Number"),                                                     //件数
                        GReceivables  = GetValue <decimal>("GReceivables"),                                           //代收款
                        freightMode   = GetValue <int>("freightMode"),                                                //付款方式
                        CarryGood     = GetValue <int>("CarryGood"),                                                  //提货方式
                        ReceiptGood   = GetValue <int>("ReceiptGood"),                                                //收货方式
                        DdTime        = DateTime.Now,                                                                 //发货时间
                        OtherExpenses = GetValue <decimal>("OtherExpenses"),                                          //其他费用
                        PickupCost    = GetValue <decimal>("PickupCost"),
                        GivegoodCost  = GetValue <decimal>("GivegoodCost"),
                        State         = 1
                    };
                    //添加
                    Tuple <bool, string> vo = BLL.BLL.LC_Customer.Add(lcc);
                    if (vo.Item1)
                    {
                        Jump("/LC/Customer/DeliverGood/CT_Success.aspx?OID=" + lcc.OrderID + "&DdTime=" + lcc.DdTime + "&GoodName=" + lcc.GoodName + "&Number=" + lcc.Number + "&freightMode=" + lcc.freightMode + "&Consignee=" + lcc.Consignee + "&Consignor=" + lcc.Consignor + "&Destination=" + lcc.Destination + "&OtherExpenses=" + lcc.OtherExpenses + "&GReceivables=" + lcc.GReceivables + "&CarryGood=" + lcc.CarryGood + "&ReceiptGood=" + lcc.ReceiptGood + "&SHPhone=" + lcc.SHPhone + "&FHPhone=" + lcc.FHPhone + "&OtherExpenses=" + lcc.OtherExpenses);
                    }
                    else if (lcc.logisticsID == "0")
                    {
                        ReturnPager("请选择物流!");
                    }
                    else
                    {
                        ReturnPager("所有内容均不能为空!");
                    }
                }
                var    myuservo1 = GetMyLoginUserVO();
                int    CityID    = myuservo1.CityID;
                string logID     = GetValue("logisticsID").StringToArray().GetIndexValue(0);
                //物流
                var vo1 = DAL.DAL.LC_User.GetLCFHADDList(myuservo1);
                if (!vo1.Item1)
                {
                    //有错误
                    Debug.Print(vo1.Item2);
                    return;
                }
                list = vo1.Item3.Distinct(new DistinctObj()).ToList();
            }
            catch (Exception)
            {
                Alert("添加失败请重试");
            }
        }