Example #1
0
        protected override void SetValue(string id)
        {
            cartast  = BLL.C_CarTast.GetModel(int.Parse(id));
            supplier = BLL.C_Supplier.GetModel(int.Parse(cartast.SupplierName));

            cid.Value = id;
            if (!string.IsNullOrEmpty(cartast.OCode))
            {
                order   = BLL.Order.GetModel(cartast.OCode);
                listord = order.OrderDetail;
            }
            if (order != null)
            {
                listcost = BLL.C_CostDetalis.GetModelList(" CID=" + order.Id);
            }
            if (cartast.TState == 1 || !TModel.Role.SiJi)
            {
                anbtn.Visible = false;
            }

            Model.Member zm = BLL.Member.GetModelByMID(cartast.CarSJ1);
            if (zm != null)
            {
                zhusiji = zm.MName;
            }
            Model.Member fm = BLL.Member.GetModelByMID(cartast.CarSJ2);
            if (fm != null)
            {
                fusiji = fm.MName;
            }
        }
Example #2
0
        protected override string btnAdd_Click()
        {
            Model.C_CarTast cartast = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.Form["tid"]));
            if (cartast.TState != 0 && cartast.TState != -1 && cartast.TState != 1)
            {
                return("此任务状态不能取消");
            }
            cartast.TState = 2;

            if (cartast.TType == 1)
            {
                int count = Convert.ToInt32(BLL.CommonBase.GetSingle("select COUNT(*) from C_CarTast where TCode='" + cartast.Name + "' and TState!=2;"));
                if (count > 0)
                {
                    return("有卸车关联任务,不能取消");
                }
            }

            if (BLL.C_CarTast.Update(cartast))
            {
                return("取消成功");
            }
            else
            {
                return("取消失败");
            }
        }
Example #3
0
 protected override void SetPowerZone()
 {
     Model.C_Mileage mile = BLL.C_Mileage.GetModelBywhere(" ( SIJI1='" + TModel.MID + "' or SIJI2='" + TModel.MID + "' ) AND DATEDIFF(DAY,CreateDate,GETDATE())=0 and type=0; ");     //当天确认
     if (mile == null)
     {
         Model.C_CarTast cm = BLL.C_CarTast.GetModelBySJ(TModel.MID);
         if (cm == null)
         {
             btnhtml.InnerHtml = "无任务,无需确认车辆里程";
         }
         else
         {
             txtSIJI1.Value   = cm.CarSJ1;
             txtSIJI2.Value   = cm.CarSJ2;
             txtCarCode.Value = cm.Spare2;
         }
     }
     else
     {
         txtSIJI1.Value    = mile.SIJI1;
         txtSIJI2.Value    = mile.SIJI2;
         txtCarCode.Value  = mile.CarCode;
         txtMileage.Value  = mile.Mileage.ToString();
         btnhtml.InnerHtml = "已确认里程";
     }
 }
Example #4
0
        protected override string btnAdd_Click()
        {
            Model.C_CarTast cd    = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.Form["cid"]));
            int             count = Convert.ToInt32(BLL.CommonBase.GetSingle("select COUNT(*) from C_CarTast where TCode='" + cd.Name + "';"));

            if (count > 0)
            {
                return("有卸车单数据关联,不能取消");
            }

            if (cd.TState != -1)
            {
                return("状态已改变,请刷新重试");
            }
            cd.TState = 2;

            if (BLL.C_CarTast.Update(cd))
            {
                return("取消成功");
            }
            else
            {
                return("取消失败");
            }
        }
Example #5
0
        protected override string btnAdd_Click()
        {
            try
            {
                Model.C_CarTast            cartast  = BLL.C_CarTast.GetModel(int.Parse(Request.Form["cid"]));
                List <Model.C_CostDetalis> listcost = BLL.C_CostDetalis.GetModelList(" CID=" + cartast.ID);
                if (cartast.TState == 1)
                {
                    return("非法操作,此任务已结束");
                }

                cartast.BDImg = Request.Form["uploadurl"];

                if (BLL.C_CarTast.Update(cartast))
                {
                    return("上传成功");
                }
                else
                {
                    return("数据有误,请重试");
                }
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
Example #6
0
        protected override void SetValue(string id)
        {
            Model.C_CarTast c = BLL.C_CarTast.GetModel(int.Parse(id));
            supplier    = BLL.C_Supplier.GetModel(int.Parse(c.SupplierName));
            cartast     = c;
            Name.Value  = c.Name;
            TType.Value = c.TType.ToString();

            Spare2.Value  = c.Spare2.ToString();
            CSpare2.Value = c.CSpare2.ToString();
            CarSJ1.Value  = c.CarSJ1.ToString();
            CarSJ2.Value  = c.CarSJ2.ToString();


            ocode.Value   = c.OCode;
            fid.Value     = c.ID.ToString();
            oid.Value     = c.OCode.ToString();
            ComDate.Value = c.ComDate.ToString();

            if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
            {
                ocode.Value = Request.QueryString["oid"];
            }
            if (c.TState != -1 && c.TState != 0)
            {
                subview.Visible = false;
            }
        }
Example #7
0
        protected override void SetValue(string id)
        {
            Model.C_CarTast c = BLL.C_CarTast.GetModel(int.Parse(id));
            Name.Value          = c.Name;
            TType.Value         = c.TType.ToString();
            SupplierName.Value  = c.SupplierName;
            SupplierName2.Value = c.SupplierName;
            SupplierName3.Value = c.SupplierName;

            SupplierAddress.Value = c.SupplierAddress;
            SupplierTelName.Value = c.SupplierTelName;
            SupplierTel.Value     = c.SupplierTel;

            uploadurl.Value = c.BDImg.ToString();
            Spare1.Value    = c.Spare1.ToString();
            ocode.Value     = c.OCode;
            fid.Value       = c.ID.ToString();
            oid.Value       = c.OCode.ToString();
            ComDate.Value   = c.ComDate.ToString();
            txtProt.Value   = c.Prot.ToString();

            if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
            {
                ocode.Value = Request.QueryString["oid"];
            }
        }
Example #8
0
        protected override void SetValue(string id)
        {
            cartast   = BLL.C_CarTast.GetModel(int.Parse(id));
            cid.Value = id;
            Model.Order order             = BLL.Order.GetModel(cartast.OCode);
            List <Model.OrderDetail> list = BLL.OrderDetail.GetList(" OrderCode='" + cartast.OCode + "' ");

            foreach (var item in list)
            {
                strordsel += "<option value='" + item.Code + "'>" + BLL.Goods.GetModel(item.GId).GName + "_可调度【" + (item.GCount - item.ReCount) + "】</option>";
            }
        }
Example #9
0
        protected override void SetPowerZone()
        {
            Spare2.DataSource     = BLL.C_Car.GetList(" IsDelete = 0 and CType='牵引车' order by ID");
            Spare2.DataTextField  = "PZCode";
            Spare2.DataValueField = "PZCode";
            Spare2.DataBind();

            CSpare2.DataSource     = BLL.C_Car.GetList(" IsDelete = 0 and CType='挂车' order by ID");
            CSpare2.DataTextField  = "PZCode";
            CSpare2.DataValueField = "PZCode";
            CSpare2.DataBind();
            //ListItem lt = new ListItem();
            //lt.Value = "";
            //lt.Text = "空项";
            //CSpare2.Items.Insert(0, lt);

            CarSJ1.DataSource     = BLL.Member.ManageMember.GetMemberEntityList("  RoleCode='SiJi' AND FMID='1' AND IsClock=0 AND IsClose=0  order by ID");
            CarSJ1.DataTextField  = "MName";
            CarSJ1.DataValueField = "MID";
            //CarSJ1.Items.Insert(0, "--请选择--");
            CarSJ1.DataBind();


            CarSJ2.DataSource     = BLL.Member.ManageMember.GetMemberEntityList("  RoleCode='SiJi' AND FMID IN('2','3') AND IsClock=0 AND IsClose=0  order by ID");
            CarSJ2.DataTextField  = "MName";
            CarSJ2.DataValueField = "MID";
            CarSJ2.DataBind();
            //CarSJ2.Items.Insert(0, "--请选择--");
            if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
            {
                ocode.Value = Request.QueryString["oid"];
                oid.Value   = Request.QueryString["oid"];
            }
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                string          id  = Request.QueryString["id"];
                Model.C_CarTast car = BLL.C_CarTast.GetModel(Convert.ToInt32(id));
                Spare2.Value  = car.Spare2.ToString();
                CSpare2.Value = car.CSpare2.ToString();
                CarSJ1.Value  = car.CarSJ1.ToString();
                CarSJ2.Value  = car.CarSJ2.ToString();

                if (!string.IsNullOrEmpty(car.OCode))
                {
                    Model.OrderDetail od = BLL.OrderDetail.GetModelCode(car.OCode);
                    goodcount = od.GCount.ToString();
                    Model.Goods good = BLL.Goods.GetModel(od.GId.ToString());
                    goodname = good.GName;
                }
            }
        }
Example #10
0
        protected override string btnAdd_Click()
        {
            Model.C_CarTast ct = BLL.C_CarTast.GetModelBySJ(TModel.MID);

            Model.C_Mileage mile0 = BLL.C_Mileage.GetModelBywhere(" ( SIJI1='" + TModel.MID + "' or SIJI2='" + TModel.MID + "' ) AND DATEDIFF(DAY,CreateDate,GETDATE())=0 and type=0; ");            //当天确认
            if (mile0 == null)
            {
                return("今日未确认里程,请确认后交车");
            }

            Model.C_Mileage mile = BLL.C_Mileage.GetModelBywhere(" ( SIJI1='" + TModel.MID + "' or SIJI2='" + TModel.MID + "' ) AND DATEDIFF(DAY,CreateDate,GETDATE())=0 and type=1; ");            //当天确认
            if (mile != null)
            {
                return("今日已交车,请勿重复提交");
            }

            try
            {
                int             licheng = Convert.ToInt32(Request.Form["txtMileage"]);
                Model.C_Mileage cm      = new Model.C_Mileage();
                cm.CarCode    = ct.Spare2;
                cm.SIJI1      = ct.CarSJ1;
                cm.SIJI2      = ct.CarSJ2;
                cm.Mileage    = licheng;
                cm.DiffCount  = Convert.ToInt32(cm.Mileage - mile0.Mileage);
                cm.Oid        = 0;
                cm.Type       = 1;
                cm.CreateDate = DateTime.Now;
                if (cm.DiffCount < 0)
                {
                    return("里程有误,交车里程不能小于确认里程");
                }
                if (BLL.C_Mileage.Add(cm) > 0)
                {
                    return("交车成功");
                }
                else
                {
                    return("交车失败,请重试");
                }
            }
            catch (Exception e)
            {
                return(e.Message);
            }
        }
Example #11
0
        protected override string btnModify_Click()
        {
            Model.C_CarTast cartast = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.Form["tid"]));
            if (cartast.TState != 1)
            {
                return("此任务状态不能设为错误标记");
            }

            cartast.TState = -2;
            if (BLL.C_CarTast.Update(cartast))
            {
                return("设置成功,司机端可以修改后提交");
            }
            else
            {
                return("设置失败");
            }
        }
Example #12
0
        protected static string htmldetails(Model.C_CarTast tast)
        {
            string xxx = "";

            if (tast.TState == -1)
            {
                xxx = "<a class=\"button button-fill button-success\" href=\"javascript:pcallhtml('/mobile/html/DDTast.aspx?id=" + tast.ID + "','调度');\">调度</a><a class=\"button button-fill button-success\" href=\"Javascript:XSTastCel('" + tast.ID + "');\">取消</a><a class=\"button button-fill button-success\" href=\"javascript:pcallhtml('/mobile/html/TastView.aspx?id=" + tast.ID + "','详情');\">详情</a>";
            }
            else if (tast.TState == 0)
            {
                xxx = "<a class=\"button button-fill button-success\" href=\"javascript:pcallhtml('/mobile/html/DDTast.aspx?id=" + tast.ID + "','修改');\">修改</a><a class=\"button button-fill button-success\" href=\"javascript:pcallhtml('/mobile/html/TastView.aspx?id=" + tast.ID + "','详情');\">详情</a>";
            }
            else
            {
                xxx = "<a class=\"button button-fill button-success\" href=\"javascript:pcallhtml('/mobile/html/TastView.aspx?id=" + tast.ID + "','详情');\">详情</a>";
            }
            return(xxx);
        }
Example #13
0
        protected override string btnAdd_Click()
        {
            Model.C_CarTast cd = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.Form["cid"]));
            if (cd.TState != -1)
            {
                return("状态已改变,请刷新重试");
            }
            cd.TState = 2;

            if (BLL.C_CarTast.Update(cd))
            {
                return("取消成功");
            }
            else
            {
                return("取消失败");
            }
        }
Example #14
0
        protected override string btnOther_Click()
        {
            Model.C_CarTast cartast = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.Form["tid"]));
            if (cartast.TState != -2)
            {
                return("此任务状态不能取消错误标记");
            }

            cartast.TState = 1;
            if (BLL.C_CarTast.Update(cartast))
            {
                return("取消成功");
            }
            else
            {
                return("取消失败");
            }
        }
        protected override void SetValue(string id)
        {
            Model.Account c = BLL.Account.GetModel(int.Parse(id));
            CName.Value    = c.CName;
            SuppName.Value = c.SupplierName;
            type.Value     = c.AType.ToString();

            Model.C_CarTast tast = BLL.C_CarTast.GetModel(c.CID);
            if (!string.IsNullOrEmpty(tast.OCode))
            {
                Model.OrderDetail od    = BLL.OrderDetail.GetModelCode(tast.OCode);
                Model.Goods       goods = BLL.Goods.GetModel(od.GId);
                GoodName.Value     = goods.GName;
                txtGoodCount.Value = c.OrderCount.ToString();
                txtGoodPrice.Value = c.OrderPrice.ToString();
            }
            Remark.Value = c.Spare2.ToString();

            fid.Value = c.ID.ToString();
        }
Example #16
0
        protected void binddata(string id)
        {
            Model.C_CarTast c = BLL.C_CarTast.GetModel(int.Parse(id));
            Name.Value          = c.Name;
            TType.Value         = c.TType.ToString();
            SupplierName.Value  = c.SupplierName;
            SupplierName2.Value = c.SupplierName;
            SupplierName3.Value = c.SupplierName;

            SupplierAddress.Value = c.SupplierAddress;
            SupplierTelName.Value = c.SupplierTelName;
            SupplierTel.Value     = c.SupplierTel;
            Spare2.Value          = c.Spare2.ToString();
            CSpare2.Value         = c.CSpare2.ToString();
            CarSJ1.Value          = c.CarSJ1.ToString();
            CarSJ2.Value          = c.CarSJ2.ToString();
            //CostType.Value = c.CostType.ToString();
            uploadurl.Value = c.BDImg.ToString();
            Spare1.Value    = c.Spare1.ToString();
            ocode.Value     = c.OCode;
            fid.Value       = c.ID.ToString();
            oid.Value       = c.OCode.ToString();
            ComDate.Value   = c.ComDate.ToString();


            if (!string.IsNullOrEmpty(c.OCode))//如果不是空车,就显示商品
            {
                Model.OrderDetail od = BLL.OrderDetail.GetModelCode(c.OCode);
                txtGood.Value      = od.GId.ToString();
                txtGoodCount.Value = od.GCount.ToString();
                txtGoodPrice.Value = od.BuyPrice.ToString();
            }

            if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
            {
                ocode.Value = Request.QueryString["oid"];
            }
        }
Example #17
0
 protected override string btnAdd_Click()
 {
     try
     {
         Model.C_CarTast cartast = BLL.C_CarTast.GetModel(int.Parse(Request.Form["cid"]));
         if (cartast.TState == 1)
         {
             return("非法操作,此任务已结束");
         }
         decimal           money = Convert.ToDecimal(Request.Form["txtGCount"]);
         Model.OrderDetail ord   = BLL.OrderDetail.GetList(" ordercode='" + cartast.OCode + "' and  code='" + Request.Form["txtGoodList"] + "' ").FirstOrDefault();
         if (ord != null)
         {
             if (money <= 0)
             {
                 return("输入数量有误或此商品已不可调度");
             }
             ord.ReCount = money;
             if (BLL.OrderDetail.Update(ord))
             {
                 return("调度成功");
             }
             else
             {
                 return("调度失败");
             }
         }
         else
         {
             return("数据有误,请重试");
         }
     }
     catch (Exception e)
     {
         return(e.Message);
     }
 }
Example #18
0
        protected override string btnModify_Click()
        {
            Hashtable MyHs = new Hashtable();

            Model.C_CarTast cartast = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.Form["tid"]));
            if (cartast.SHInt != 0)
            {
                return("此任务审核状态为已审核状态");
            }

            cartast.SHInt = 1;
            BLL.C_CarTast.Update(cartast, MyHs);

            int acount = Convert.ToInt32(BLL.CommonBase.GetSingle("select count(*) from Account where CName='" + cartast.Name + "';"));

            if (acount == 0)
            {
                if (cartast.TType == 1 || cartast.TType == 2)
                {
                    Model.Member mc1 = BLL.Member.GetModelByMID(cartast.CarSJ1);
                    Model.Member mc2 = BLL.Member.GetModelByMID(cartast.CarSJ2);

                    string SJ1 = ""; string SJ2 = "";
                    if (mc1 != null)
                    {
                        SJ1 = mc1.MName;
                    }
                    if (mc2 != null)
                    {
                        SJ2 = mc2.MName;
                    }

                    decimal retotalMoney = 0;//实际总额
                    decimal recount      = 0;
                    decimal reprice      = 0;
                    string  gname        = "";
                    string  unit         = "";
                    if (!string.IsNullOrEmpty(cartast.OCode))
                    {
                        Model.OrderDetail od = BLL.OrderDetail.GetModelCode(cartast.OCode);
                        if (od != null)
                        {
                            retotalMoney = od.ReCount * od.BuyPrice;
                            recount      = od.ReCount;
                            reprice      = od.BuyPrice;

                            Model.Goods mg = BLL.Goods.GetModel(od.GId);
                            if (mg != null)
                            {
                                gname = mg.GName;
                                unit  = mg.Unit;
                            }
                        }
                    }

                    Model.Account acc = new Model.Account();
                    acc.CID        = cartast.ID;
                    acc.CName      = cartast.Name;
                    acc.AType      = cartast.TType == 1 ? 0 : 1;
                    acc.SupplierID = Convert.ToInt32(cartast.SupplierName);
                    var supplier = BLL.C_Supplier.GetModel(int.Parse(cartast.SupplierName));
                    acc.SupplierName = supplier.Name;
                    acc.TotalMoney   = retotalMoney;
                    acc.ReMoney      = 0;
                    acc.CreateDate   = DateTime.Now;
                    acc.AStutas      = 0;
                    acc.comDate      = DateTime.MaxValue;
                    acc.OrderCount   = recount;
                    acc.OrderPrice   = reprice;
                    acc.SJ1          = SJ1;
                    acc.SJ2          = SJ2;
                    acc.GName        = gname;
                    acc.Unit         = unit;
                    BLL.Account.Add(acc, MyHs);
                }
            }

            if (BLL.CommonBase.RunHashtable(MyHs))
            {
                return("审核成功");
            }
            else
            {
                return("审核失败");
            }
        }
Example #19
0
        protected override string btnModify_Click()
        {
            Hashtable MyHs = new Hashtable();

            Model.C_CarTast c = BLL.C_CarTast.GetModelname(Request.Form["Name"]);
            //Model.C_CarTast c = new Model.C_CarTast();
            //c.Name = Request.Form["Name"];
            c.TType = int.Parse(Request.Form["TType"]);
            if (c.TType == 1)
            {
                c.SupplierName = Request.Form["SupplierName"];
            }
            else if (c.TType == 2)
            {
                c.SupplierName = Request.Form["SupplierName2"];
            }
            else
            {
                c.SupplierName = Request.Form["SupplierName3"];
            }

            c.SupplierAddress = Request.Form["SupplierAddress"];
            c.SupplierTelName = Request.Form["SupplierTelName"];
            c.SupplierTel     = Request.Form["SupplierTel"];
            c.Spare2          = Request.Form["Spare2"];
            c.CSpare2         = Request.Form["CSpare2"];
            c.CarSJ1          = Request.Form["CarSJ1"];
            c.CarSJ2          = Request.Form["CarSJ2"];

            //c.CostType = int.Parse(Request.Form["CostType"]);
            c.BDImg   = Request.Form["uploadurl"];
            c.OCode   = Request.Form["ocode"];
            c.Spare1  = Request.Form["Spare1"];
            c.ComDate = DateTime.Parse(Request.Form["ComDate"]);

            #region 司机车辆验证
            Model.C_Car car = BLL.C_Car.GetModelByCode(c.Spare2);
            if (car == null)
            {
                return("此牵引车不存在,请正确输入车辆牌照");
            }
            //if (!string.IsNullOrEmpty(car.Spare1)&&car.ID!=c.ID)
            //	return "此牵引车任务未完成,请选择别的车辆";
            if (!string.IsNullOrEmpty(c.CSpare2))
            {
                Model.C_Car car2 = BLL.C_Car.GetModelByCode(c.CSpare2);
                if (car2 == null)
                {
                    return("此挂车不存在,请正确输入车辆牌照");
                }
                //if (!string.IsNullOrEmpty(car2.Spare1) && car.ID != c.ID)
                //	return "此挂车任务未完成,请选择别的车辆";
            }

            //存在商品订单
            if (!string.IsNullOrEmpty(c.OCode))
            {
                Model.OrderDetail od = BLL.OrderDetail.GetModelCode(c.OCode);
                od.GId      = Convert.ToInt32(Request.Form["txtGood"]);
                od.BuyPrice = Convert.ToDecimal(Request.Form["txtGoodPrice"]);
                od.GCount   = Convert.ToDecimal(Request.Form["txtGoodCount"]);
                od.ReCount  = Convert.ToDecimal(Request.Form["txtGoodCount"]);
                BLL.OrderDetail.Update(od, MyHs);
            }


            Model.Member siji1 = BLL.Member.GetModelByMID(c.CarSJ1);
            if (siji1 != null)
            {
                if (siji1.FMID != "1")
                {
                    return("此司机不是主司机");
                }
            }
            else
            {
                return("主司机不存在");
            }

            if (!string.IsNullOrEmpty(c.CarSJ2))
            {
                Model.Member siji2 = BLL.Member.GetModelByMID(c.CarSJ2);
                if (siji2 != null)
                {
                    if (siji2.FMID != "2" && siji2.FMID != "3")
                    {
                        return("此司机不是押运员");
                    }
                }
                else
                {
                    return("押运员不存在");
                }
            }


            #endregion
            c.ID = int.Parse(Request.Form["fid"]);
            BLL.C_CarTast.Update(c, MyHs);
            if (BLL.CommonBase.RunHashtable(MyHs))
            {
                return("修改成功");
            }
            else
            {
                return("修改失败");
            }
        }
Example #20
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            string strWhere = "'1'='1' and AType=1 ";

            if (!string.IsNullOrEmpty(context.Request["tState"]))
            {
                strWhere += " and AStutas=" + context.Request["tState"] + " ";
            }
            if (!string.IsNullOrEmpty(context.Request["CName"]))
            {
                strWhere += " and CName like '%" + HttpUtility.UrlDecode(context.Request["CName"]) + "%'";
            }
            if (context.Request["SupplierName"] != "--请选择--")
            {
                strWhere += " and  SupplierID =" + context.Request["SupplierName"] + " ";
            }
            if (!string.IsNullOrEmpty(context.Request["CSpare2"]))
            {
                strWhere += "AND CName in(select Name from C_CarTast  where OCode in(select OrderCode from OrderDetail where GId in(select GID from Goods where GName='" + context.Request["CSpare2"] + "'))) ";
            }
            if (!string.IsNullOrEmpty(context.Request["startDate"]))
            {
                strWhere += " and CreateDate>='" + context.Request["startDate"] + " 00:00:00' ";
            }
            if (!string.IsNullOrEmpty(context.Request["endDate"]))
            {
                strWhere += " and CreateDate<='" + context.Request["endDate"] + " 23:59:59' ";
            }
            if (!string.IsNullOrEmpty(context.Request["startDate2"]))
            {
                strWhere += " and ComDate>='" + context.Request["startDate2"] + " 00:00:00' ";
            }
            if (!string.IsNullOrEmpty(context.Request["endDate2"]))
            {
                strWhere += " and ComDate<='" + context.Request["endDate2"] + " 23:59:59' ";
            }
            decimal GCount  = Convert.ToDecimal(BLL.CommonBase.GetSingle(" select ISNULL(SUM(TotalMoney),0) from Account where  " + strWhere + " "));
            decimal ReCount = Convert.ToDecimal(BLL.CommonBase.GetSingle(" select ISNULL(SUM(OrderCount),0) from Account where  " + strWhere + " "));

            int count;
            List <Model.Account> ListNotice = BLL.Account.GetList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < ListNotice.Count; i++)
            {
                sb.Append(ListNotice[i].ID + "~");
                if (i == 0)
                {
                    sb.Append((i + 1) + (pageIndex - 1) * pageSize + "<input type=\"hidden\" id=\"Sum1\" value='" + GCount + "' /><input type=\"hidden\" id=\"Sum2\" value='" + ReCount + "' />~");
                }
                else
                {
                    sb.Append((i + 1) + (pageIndex - 1) * pageSize + "~");
                }

                //sb.Append(ListNotice[i].Name + "~");

                sb.Append(ListNotice[i].CName + "~");
                sb.Append(ListNotice[i].SupplierName + "~");

                sb.Append(ListNotice[i].TotalMoney + "~");

                //Model.C_CarTast tast= BLL.C_CarTast.GetModelname(ListNotice[i].CName);
                //string shuliang = "";
                //string jiage = "";
                //if (!string.IsNullOrWhiteSpace(tast.OCode))
                //{
                //    Model.OrderDetail od= BLL.OrderDetail.GetModelCode(tast.OCode);
                //    shuliang = od.ReCount.ToString();
                //    jiage = od.BuyPrice.ToString();
                //}
                Model.C_CarTast tast = BLL.C_CarTast.GetModelname(ListNotice[i].CName);
                //string GName = "";
                //string goodsrecount = "";
                //string goodsprice = "";
                //string goodscount = "";
                //Model.Goods g = null;
                //if (tast != null)
                //{
                //    if (!string.IsNullOrWhiteSpace(tast.OCode))
                //    {
                //        Model.OrderDetail od = BLL.OrderDetail.GetModelCode(tast.OCode);
                //        if (od != null)
                //        {
                //            goodsrecount = od.ReCount.ToString();
                //            goodscount = od.GCount.ToString();
                //            goodsprice = od.BuyPrice.ToString();
                //        }
                //        g = BLL.Goods.GetModel(od.GId);
                //        if (g != null)
                //            GName = g.GName;
                //    }
                //}

                sb.Append(ListNotice[i].GName + "~");
                sb.Append(ListNotice[i].OrderCount + "~");
                sb.Append(ListNotice[i].OrderPrice + "~");

                sb.Append(ListNotice[i].ReMoney + "~");

                sb.Append((ListNotice[i].AStutas == 0 ? "未结账" : "已结账") + "~");
                sb.Append((ListNotice[i].Spare == "1" ? "<span style='color:green;'>已开发票</span>" : "<span style='color:red;'>未开发票</span>") + "~");
                sb.Append((ListNotice[i].CreateDate) + "~");
                sb.Append((ListNotice[i].comDate) + "~");
                sb.Append((ListNotice[i].Spare2) + "~");

                if (ListNotice[i].AStutas == 0)
                {
                    //sb.Append("<div class=\"pay btn btn-success\" onclick=\"callhtml('/Car/AccountDetailsDown.aspx?id=" + ListNotice[i].ID + "','结账');onclickMenu()\">结账</div>");
                }
                if (string.IsNullOrEmpty(ListNotice[i].Spare))
                {
                    sb.Append("<div class=\"pay btn btn-success\" onclick=\"execfp('" + ListNotice[i].ID + "')\">开发票</div>");
                }
                else
                {
                    sb.Append("<div class=\"pay btn btn-danger\" onclick=\"celfp('" + ListNotice[i].ID + "')\">取消发票</div>");
                }
                sb.Append("≌");
                sb.Append("≠");
                ////数量
                sb.Append("10");
                sb.Append("≠");
                //内容(买家信息

                if (tast != null)
                {
                    //Model.Member mc1 = BLL.Member.GetModelByMID(tast.CarSJ1);
                    //Model.Member mc2 = BLL.Member.GetModelByMID(tast.CarSJ2);
                    sb.Append("供应商地址:" + tast.SupplierAddress);
                    sb.Append("<br/>主司机:" + ListNotice[i].SJ1);
                    sb.Append("<br/>押运员:" + ListNotice[i].SJ2);

                    if (!string.IsNullOrEmpty(tast.OCode)) //装车  卸车
                    {
                        sb.Append("<br/>商品订单:" + tast.OCode);
                        //if (g != null)
                        //{
                        sb.Append("<br/>实际数量:" + ListNotice[i].OrderCount + ListNotice[i].Unit);
                        sb.Append("<br/>价格:" + ListNotice[i].OrderPrice);
                        sb.Append(string.Format("<br/><span style='color:black; font-size:16px;'>{0}</span>&nbsp;&nbsp;&nbsp;<span style='color:red; font-size:20px;'>{1}</span><span style='color:green;'>{2}</span>", ListNotice[i].GName, ListNotice[i].OrderCount, ListNotice[i].Unit));
                        //}
                    }
                    sb.Append("<br/>磅单图片:<img src='" + tast.BDImg + "' width='5%' />");
                }
                sb.Append("≌");
                if (ListNotice.Count == i + 1)
                {
                    sb.Append("~");
                    sb.Append("~");
                    sb.Append("<strong style='color:red;'>本页合计<strong>~");
                    sb.Append("~");
                    sb.Append("<strong style='color:red;'>" + ListNotice.Sum(a => a.TotalMoney) + "</strong>~");
                    sb.Append("~");
                    sb.Append("<strong style='color:red;'>" + ListNotice.Sum(a => a.OrderCount) + "</strong>~");
                    sb.Append("~");


                    sb.Append("~");
                    sb.Append("≌");
                    sb.Append("≠");
                }
            }
            var info = new { PageData = Traditionalized(sb), TotalCount = count };

            //var json = new { PageData = sb.ToString(), TotalCount = count };匿名类
            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }
Example #21
0
        protected override string btnModify_Click()
        {
            //Model.C_CarTast c = new Model.C_CarTast();
            Model.C_CarTast c = BLL.C_CarTast.GetModel(int.Parse(Request.Form["fid"]));
            c.Name  = Request.Form["Name"];
            c.TType = int.Parse(Request.Form["TType"]);


            c.Spare2  = Request.Form["Spare2"];
            c.CSpare2 = Request.Form["CSpare2"];
            c.CarSJ1  = Request.Form["CarSJ1"];
            c.CarSJ2  = Request.Form["CarSJ2"];

            c.ComDate = DateTime.Parse(Request.Form["ComDate"]);

            #region 司机车辆验证
            Model.C_Car car  = BLL.C_Car.GetModelByCode(c.Spare2);
            Model.C_Car car2 = null;
            if (car == null)
            {
                return("此牵引车不存在,请正确输入车辆牌照");
            }
            //if (!string.IsNullOrEmpty(car.Spare1))
            //	return "此牵引车任务未完成,请选择别的车辆";
            if (!string.IsNullOrEmpty(c.CSpare2))
            {
                car2 = BLL.C_Car.GetModelByCode(c.CSpare2);
                if (car2 == null)
                {
                    return("此挂车不存在,请正确输入车辆牌照");
                }
                //if (!string.IsNullOrEmpty(car2.Spare1))
                //	return "此挂车任务未完成,请选择别的车辆";
            }

            Model.Member siji1 = BLL.Member.GetModelByMID(c.CarSJ1);
            if (siji1 != null)
            {
                if (siji1.FMID != "1")
                {
                    return("此司机不是主司机");
                }
            }
            else
            {
                return("主司机不存在");
            }
            Model.Member siji2 = BLL.Member.GetModelByMID(c.CarSJ2);
            if (siji2 != null)
            {
                if (siji2.FMID != "2" && siji2.FMID != "3")
                {
                    return("此司机不是押运员");
                }
            }
            else
            {
                return("押运员不存在");
            }
            #endregion

            c.TState = 0;
            c.DDMID  = TModel.MID;
            if (BLL.C_CarTast.Update(c))
            {
                return("调度成功");
            }
            else
            {
                return("调度失败");
            }
        }
Example #22
0
        protected override string btnModify_Click()
        {
            lock (obj)
            {
                try
                {
                    Model.C_CarTast c = null;
                    if (string.IsNullOrEmpty(Request.Form["fid"]))
                    {
                        c = new Model.C_CarTast();
                    }
                    else
                    {
                        c = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.Form["fid"]));
                    }
                    c.Name  = Request.Form["Name"];
                    c.TType = int.Parse(Request.Form["TType"]);
                    if (c.TType == 1)
                    {
                        c.SupplierName = Request.Form["SupplierName"];
                    }
                    else if (c.TType == 2)
                    {
                        c.SupplierName = Request.Form["SupplierName2"];
                    }
                    else
                    {
                        c.SupplierName = Request.Form["SupplierName3"];
                    }

                    c.SupplierAddress = Request.Form["SupplierAddress"];
                    c.SupplierTelName = Request.Form["SupplierTelName"];
                    c.SupplierTel     = Request.Form["SupplierTel"];
                    c.BDImg           = Request.Form["uploadurl"];
                    //c.OCode = Request.Form["ocode"];
                    c.Spare1  = Request.Form["Spare1"];
                    c.Prot    = Convert.ToInt32(Request.Form["txtProt"]);
                    c.ComDate = DateTime.Parse(Request.Form["ComDate"]);

                    string          zcCode  = Request.Form["zcCode"];
                    Model.C_CarTast carTast = BLL.C_CarTast.GetModelname(zcCode);
                    if (carTast == null)
                    {
                        return("未查询到装车单");
                    }
                    if (carTast.XSMID != TModel.MID)
                    {
                        return("此装车单无权限");
                    }

                    Hashtable MyHs = new Hashtable();

                    if (c.TType != 3)//不是空车才能生成商品订单
                    {
                        #region 生成商品订单
                        string      code   = "";
                        string      goodid = Request.Form["txtGood"];
                        Model.Goods go     = BLL.Goods.GetModel(goodid);
                        if (go == null)
                        {
                            return("此商品找不到");
                        }

                        if (!string.IsNullOrEmpty(goodid))
                        {
                            decimal goodcount = 0;
                            decimal goodprice = 0;
                            try
                            {
                                goodcount = Convert.ToDecimal(Request.Form["txtGoodCount"]);
                                goodprice = Convert.ToDecimal(Request.Form["txtGoodPrice"]);
                            }
                            catch (Exception e)
                            {
                                return(e.Message);
                            }
                            //先生成订单主表
                            Model.Order order = new Model.Order();
                            DateTime    dt    = DateTime.Now;
                            code              = dt.ToString("yyyyMMddHHmmssfff");// dt.Year.ToString() + dt.Month.ToString() + dt.Day.ToString() + dt.Hour.ToString() + dt.Minute.ToString() + dt.Second.ToString() + dt.Millisecond.ToString();
                            order.Code        = code;
                            order.ReceiveId   = 0;
                            order.CreatedBy   = TModel.MID;
                            order.CreatedTime = DateTime.Now;
                            //order.GoodCount
                            decimal count = goodcount; decimal totalMoney = goodcount * goodprice;
                            string  error = string.Empty;

                            //生成订单明细表
                            Model.OrderDetail od = new Model.OrderDetail();
                            od.BuyPrice    = goodprice;
                            od.Code        = GetGuid();
                            od.CreatedBy   = TModel.MID;
                            od.CreatedTime = DateTime.Now;
                            od.GCount      = count;
                            od.GId         = Convert.ToInt32(goodid);
                            //查看库存数量是否足够,不够的话暂时不能提交订单

                            od.IsDeleted  = false;
                            od.OrderCode  = order.Code;
                            od.Status     = 1;
                            od.TotalMoney = od.GCount * od.BuyPrice;
                            totalMoney   += od.TotalMoney;
                            BLL.OrderDetail.Insert(od, MyHs);

                            order.GoodCount          = count;
                            order.IsDeleted          = false;
                            order.MID                = c.SupplierName;
                            order.OrderTime          = DateTime.Now;
                            order.TotalPrice         = totalMoney;
                            order.DisCountTotalPrice = order.TotalPrice;// * BLL.Configuration.Model.E_GWDiscount;

                            order.ExpressCompany = c.Name;
                            order.Status         = 2;
                            c.OCode = order.Code;
                            BLL.Order.Insert(order, MyHs);

                            if (!string.IsNullOrEmpty(error))
                            {
                                return(error);
                            }
                        }
                        #endregion
                    }

                    c.TState = -1;
                    c.XSMID  = TModel.MID;
                    c.TCode  = zcCode;
                    int ncount = Convert.ToInt32(BLL.CommonBase.GetSingle("select COUNT(*) from C_CarTast where Name='" + c.Name + "';"));
                    if (ncount > 0)
                    {
                        return("订单号重复,请刷新重试");
                    }

                    //int tid = BLL.C_CarTast.Add(c);
                    BLL.C_CarTast.Add(c, MyHs);
                    //if (tid > 0)
                    //{
                    //car.Spare1 = tid.ToString();
                    //BLL.C_Car.Update(car, MyHs);
                    //if (car2 != null)
                    //{
                    //	car.Spare1 = tid.ToString();
                    //	BLL.C_Car.Update(car2, MyHs);
                    //}
                    //}
                    //else {
                    //	return "任务添加失败";
                    //}
                    if (BLL.CommonBase.RunHashtable(MyHs))
                    {
                        return("添加成功");
                    }
                    else
                    {
                        return("添加失败");
                    }
                }
                catch (Exception e)
                {
                    return(e.Message);
                }
            }
        }
Example #23
0
        protected override void SetPowerZone()
        {
            //CostType.DataSource = BLL.C_CostType.GetList(" 1 = 1  order by ID");
            //CostType.DataTextField = "Name";
            //CostType.DataValueField = "ID";
            //CostType.DataBind();


            txtGood.DataSource     = BLL.Goods.GetList(" IsDeleted = 0 order by GID");
            txtGood.DataTextField  = "GName";
            txtGood.DataValueField = "GID";
            txtGood.DataBind();
            txtGood.Items.Insert(0, "--请选择--");

            //         Spare2.DataSource = BLL.C_Car.GetList(" IsDelete = 0 and CType='牵引车' order by ID");
            //Spare2.DataTextField = "PZCode";
            //Spare2.DataValueField = "PZCode";
            //Spare2.DataBind();

            //CSpare2.DataSource = BLL.C_Car.GetList(" IsDelete = 0 and CType='挂车' order by ID");
            //CSpare2.DataTextField = "PZCode";
            //CSpare2.DataValueField = "PZCode";
            //CSpare2.DataBind();

            SupplierName.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   and Type=1 order by ID");
            SupplierName.DataTextField  = "Name";
            SupplierName.DataValueField = "ID";
            SupplierName.DataBind();
            SupplierName.Items.Insert(0, "--请选择--");
            SupplierName2.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   and Type=2  order by ID");
            SupplierName2.DataTextField  = "Name";
            SupplierName2.DataValueField = "ID";
            SupplierName2.DataBind();
            SupplierName2.Items.Insert(0, "--请选择--");
            SupplierName3.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   order by ID");
            SupplierName3.DataTextField  = "Name";
            SupplierName3.DataValueField = "ID";
            SupplierName3.DataBind();
            SupplierName3.Items.Insert(0, "--请选择--");

            Name.Value = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
            {
                ocode.Value = Request.QueryString["oid"];
                oid.Value   = Request.QueryString["oid"];
            }
            else
            {
            }
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                Model.C_CarTast ct = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.QueryString["id"]));
                Name.Value = ct.Name;

                sid.Value = ct.SupplierName;
                if (ct.TType == 1)
                {
                    SupplierName.Value = ct.SupplierName;
                }
                else if (ct.TType == 2)
                {
                    SupplierName2.Value = ct.SupplierName;
                }
                else
                {
                    SupplierName3.Value = ct.SupplierName;
                }
                SupplierAddress.Value = ct.SupplierAddress;

                Model.OrderDetail od = BLL.OrderDetail.GetModelCode(ct.OCode);
                if (od != null)
                {
                    txtGood.Value      = od.GId.ToString();
                    txtGoodCount.Value = od.GCount.ToString();
                    txtGoodPrice.Value = od.BuyPrice.ToString();
                }
            }
            //ocode.Disabled = true;
        }
Example #24
0
        protected override void SetPowerZone()
        {
            txtGood.DataSource     = BLL.Goods.GetList(" IsDeleted = 0 order by GID");
            txtGood.DataTextField  = "GName";
            txtGood.DataValueField = "GID";
            txtGood.DataBind();
            txtGood.Items.Insert(0, "--请选择--");

            SupplierName.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   and Type=1 order by ID");
            SupplierName.DataTextField  = "Name";
            SupplierName.DataValueField = "ID";
            SupplierName.DataBind();
            SupplierName.Items.Insert(0, "--请选择--");
            SupplierName2.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   and Type=2  order by ID");
            SupplierName2.DataTextField  = "Name";
            SupplierName2.DataValueField = "ID";
            SupplierName2.DataBind();
            SupplierName2.Items.Insert(0, "--请选择--");
            SupplierName3.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   order by ID");
            SupplierName3.DataTextField  = "Name";
            SupplierName3.DataValueField = "ID";
            SupplierName3.DataBind();
            SupplierName3.Items.Insert(0, "--请选择--");

            Name.Value = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
            {
                ocode.Value = Request.QueryString["oid"];
                oid.Value   = Request.QueryString["oid"];
            }
            else
            {
            }
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                Model.C_CarTast ct = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.QueryString["id"]));
                Name.Value = ct.Name;

                sid.Value = ct.SupplierName;
                if (ct.TType == 1)
                {
                    SupplierName.Value = ct.SupplierName;
                }
                else if (ct.TType == 2)
                {
                    SupplierName2.Value = ct.SupplierName;
                }
                else
                {
                    SupplierName3.Value = ct.SupplierName;
                }
                SupplierAddress.Value = ct.SupplierAddress;

                Model.OrderDetail od = BLL.OrderDetail.GetModelCode(ct.OCode);
                if (od != null)
                {
                    txtGood.Value      = od.GId.ToString();
                    txtGoodCount.Value = od.GCount.ToString();
                    txtGoodPrice.Value = od.BuyPrice.ToString();
                }



                //装车信息
                if (ct.TType != 1)
                {
                    xcView.Visible = false;
                    tcode          = ct.TCode;
                    CTModel        = BLL.C_CarTast.GetModelname(tcode);
                    if (CTModel != null)
                    {
                        SuppModel = BLL.C_Supplier.GetModel(Convert.ToInt32(CTModel.SupplierName));
                        if (!string.IsNullOrEmpty(CTModel.OCode))
                        {
                            OdModel = BLL.OrderDetail.GetList(" ordercode='" + CTModel.OCode + "'; ").FirstOrDefault();
                            Good    = BLL.Goods.GetModel(OdModel.GId);
                        }
                    }
                }
                else
                {
                    zcView.Visible = false;
                    List <Model.C_CarTast> carList = BLL.C_CarTast.GetModelList(" TCode='" + ct.Name + "' ");
                    foreach (var item in carList)
                    {
                        CarTast cModel = new CarTast();
                        cModel.Code = item.Name;
                        cModel.Supp = BLL.C_Supplier.GetModel(Convert.ToInt32(item.SupplierName)).Name;
                        Model.OrderDetail XCod = BLL.OrderDetail.GetModelCode(item.OCode);
                        if (XCod != null)
                        {
                            cModel.Count    = XCod.GCount;
                            cModel.ReCount  = XCod.ReCount;
                            cModel.GoodName = BLL.Goods.GetModel(Convert.ToInt32(XCod.GId)).GName;
                        }
                        cModel.CreateTime = item.CreateDate;
                        XCList.Add(cModel);
                    }
                }
            }
            //ocode.Disabled = true;
        }
Example #25
0
        /// <summary>
        /// 更新基本资料
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected override string btnModify_Click()
        {
            Hashtable MyHs = new Hashtable();

            if (Request.Form["chkCloseAll"] == "on" || Request.Form["chkClockAll"] == "on")
            {
                string where = "";
                if (Request.Form["chkCloseAll"] == "on")
                {
                    where += string.Format(" IsClose = {0} ", (MemberModel.IsClose ? 1 : 0));
                }
                if (Request.Form["chkClockAll"] == "on")
                {
                    where += string.Format(" IsClock = {0} ", (MemberModel.IsClock ? 1 : 0));
                }
                if (!string.IsNullOrEmpty(where))
                {
                    MyHs.Add(string.Format("update Member set {0} where MID in (select mid from [dbo].[getSubBDMember]('{1}'))", where, MemberModel.MID), null);
                }
                //List<Model.Member> list = BllModel.GetMemberEntityList("MID in (select mid from getTreeBuyMID('" + MemberModel.MID + "'))");
                //foreach (Model.Member item in list)
                //{
                //    if (Request.Form["chkCloseAll"] == "on")
                //        item.IsClose = MemberModel.IsClose;
                //    if (Request.Form["chkClockAll"] == "on")
                //        item.IsClock = MemberModel.IsClock;
                //    BllModel.Update(item, MyHs);
                //}
            }

            BllModel.Update(MemberModel, MyHs);
            //string error = BLL.Member.CanSetAgency(MemberModel);
            //if (!string.IsNullOrEmpty(error))
            //{
            //    return error;
            //}
            //MyHs.Add(" update member set MSH = '" + MemberModel.MID + "' where  " + BLL.Member.GetLeaderCondition(MemberModel) + " and MID <> '" + MemberModel.MID + "'", null);
            if (MemberModel.Role.IsAdmin)
            {
                UpdateQuestion(MemberModel.ID, MyHs);
            }
            if (BLL.CommonBase.RunHashtable(MyHs))
            {
                Hashtable            MyHs2       = new Hashtable();
                List <Model.Account> listaccount = BLL.Account.GetModelList("");
                foreach (var item in listaccount)
                {
                    Model.C_CarTast tast = BLL.C_CarTast.GetModelname(item.CName);
                    Model.Goods     g    = null;
                    if (tast != null)
                    {
                        if (!string.IsNullOrWhiteSpace(tast.OCode))
                        {
                            Model.Member mc1 = BLL.Member.GetModelByMID(tast.CarSJ1);
                            Model.Member mc2 = BLL.Member.GetModelByMID(tast.CarSJ2);
                            if (mc1 != null)
                            {
                                item.SJ1 = mc1.MName;
                            }
                            if (mc2 != null)
                            {
                                item.SJ2 = mc2.MName;
                            }

                            Model.OrderDetail od = BLL.OrderDetail.GetModelCode(tast.OCode);
                            g = BLL.Goods.GetModel(od.GId);
                            if (g != null)
                            {
                                item.GName = g.GName;
                                item.Unit  = g.Unit;
                            }
                        }
                    }
                    BLL.Account.Update(item, MyHs2);
                }

                BLL.CommonBase.RunHashtable(MyHs2);

                BLL.OperationRecordBLL.Add(TModel.MID, ChangeType.O_XGHYZL, string.Format("修改{0}的资料", MemberModel.MID));
                return("操作成功");
            }
            return("操作失败");
        }
Example #26
0
        protected override void SetPowerZone()
        {
            tcode     = Request.QueryString["tcode"];
            CTModel   = BLL.C_CarTast.GetModelname(tcode);
            SuppModel = BLL.C_Supplier.GetModel(Convert.ToInt32(CTModel.SupplierName));
            if (!string.IsNullOrEmpty(CTModel.OCode))
            {
                OdModel = BLL.OrderDetail.GetList(" ordercode='" + CTModel.OCode + "'; ").FirstOrDefault();
                Good    = BLL.Goods.GetModel(OdModel.GId);
            }



            txtGood.DataSource     = BLL.Goods.GetList(" IsDeleted = 0 order by GID");
            txtGood.DataTextField  = "GName";
            txtGood.DataValueField = "GID";
            txtGood.DataBind();
            txtGood.Items.Insert(0, "--请选择--");

            SupplierName.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   and Type=1 order by ID");
            SupplierName.DataTextField  = "Name";
            SupplierName.DataValueField = "ID";
            SupplierName.DataBind();
            SupplierName.Items.Insert(0, "--请选择--");
            SupplierName2.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   and Type=2  order by ID");
            SupplierName2.DataTextField  = "Name";
            SupplierName2.DataValueField = "ID";
            SupplierName2.DataBind();
            SupplierName2.Items.Insert(0, "--请选择--");
            SupplierName3.DataSource     = BLL.C_Supplier.GetList(" IsDelete = 0 and (Spare3 is null or Spare3='')   order by ID");
            SupplierName3.DataTextField  = "Name";
            SupplierName3.DataValueField = "ID";
            SupplierName3.DataBind();
            SupplierName3.Items.Insert(0, "--请选择--");

            Name.Value = DateTime.Now.ToString("yyyyMMddHHmmssfff");
            if (!string.IsNullOrEmpty(Request.QueryString["oid"]))
            {
                ocode.Value = Request.QueryString["oid"];
                oid.Value   = Request.QueryString["oid"];
            }
            else
            {
            }
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                Model.C_CarTast ct = BLL.C_CarTast.GetModel(Convert.ToInt32(Request.QueryString["id"]));
                Name.Value = ct.Name;

                sid.Value = ct.SupplierName;
                if (ct.TType == 1)
                {
                    SupplierName.Value = ct.SupplierName;
                }
                else if (ct.TType == 2)
                {
                    SupplierName2.Value = ct.SupplierName;
                }
                else
                {
                    SupplierName3.Value = ct.SupplierName;
                }
                SupplierAddress.Value = ct.SupplierAddress;

                Model.OrderDetail od = BLL.OrderDetail.GetModelCode(ct.OCode);
                if (od != null)
                {
                    txtGood.Value      = od.GId.ToString();
                    txtGoodCount.Value = od.GCount.ToString();
                    txtGoodPrice.Value = od.BuyPrice.ToString();
                }
            }
        }
Example #27
0
        public override void ProcessRequest(HttpContext context)
        {
            base.ProcessRequest(context);
            Model.Member memberModel = (TModel == null ? BllModel.TModel : TModel);
            string       strWhere    = " IsDeleted=0 ";

            if (!memberModel.Role.Super)
            {
                strWhere += " and MID='" + memberModel.MID + "'";
            }
            if (!string.IsNullOrEmpty(context.Request["tState"]))
            {
                strWhere += " and Status = " + context.Request["tState"] + " ";
            }
            if (context.Request["mKey"] != "--请选择--")
            {
                if (memberModel.Role.Super)
                {
                    strWhere += string.Format(" and ( MID='{0}' ) ", (context.Request["mKey"]));
                }
            }
            if (!string.IsNullOrEmpty(context.Request["startDate"]))
            {
                strWhere += " and CreatedTime>'" + context.Request["startDate"] + " 00:00:00' ";
            }
            if (!string.IsNullOrEmpty(context.Request["endDate"]))
            {
                strWhere += " and CreatedTime<'" + context.Request["endDate"] + " 23:59:59' ";
            }

            int count;
            List <Model.Order> List = BLL.Order.GetList(strWhere, pageIndex, pageSize, out count);

            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < List.Count; i++)
            {
                sb.Append(List[i].Id + "~");
                sb.Append(List[i].Code + "~");

                string suppname = "";
                if (!string.IsNullOrEmpty(List[i].MID) && List[i].MID != "--请选择--")
                {
                    suppname = BLL.C_Supplier.GetModel(Convert.ToInt32(List[i].MID)).Name;
                }

                sb.Append(suppname + "~");
                sb.Append(List[i].ExpressCompany + "~");
                sb.Append(List[i].TotalPrice + "~");
                //sb.Append((List[i].DisCountTotalPrice).ToFixedString() + "~");
                sb.Append(List[i].GoodCount + "~");
                sb.Append(List[i].OrderTime.ToString("yyyy-MM-dd HH:mm") + "~");
                int    status = List[i].Status;
                string resu   = string.Empty;
                switch (status)
                {
                case 1:
                    resu = "已打包待调度~";
                    //if (List[i].MID == memberModel.MID)
                    //{
                    resu += "<input type='button' value='调度' class='btn btn-success btn-sm' onclick=\"callhtml('/Car/AddTast.aspx?oid=" + List[i].Code + "','调度');\" />";
                    //}
                    break;

                case 2:
                    resu = "已调度未完成~";
                    //if (memberModel.Role.Super)
                    //{
                    //    resu += "<input type='button' value='发货' class='btn btn-success btn-sm' onclick='sendOrder(" + List[i].Id + ")' />";
                    //}
                    Model.C_CarTast tast = BLL.C_CarTast.GetModel(List[i].Code);
                    //resu +="<input type='button' value='任务详情' class='btn btn-success btn-sm' onclick=\"callhtml('/Car/AddTast.aspx?oid=" + List[i].Code + "&id="+List[i].Id+"','调度任务详情');\" />";
                    resu += "<input type='button' value='订单详情' class='btn btn-success btn-sm' onclick=\"callhtml('/Shop/ShowOrder.aspx?id=" + List[i].Code + "','订单详情');\" />";
                    break;

                //case 3:
                //    resu = "已发货&nbsp;&nbsp;<span class='seeExpress' onclick='seeExpress(" + List[i].Id + ")'>查看物流</span>~";
                //    if (List[i].MID == memberModel.MID)
                //    {
                //        resu += "<input type='button' value='确认收货' class='btn btn-success btn-sm' onclick='receiveOrder(" + List[i].Id + ")' />";
                //    }
                //    break;
                case 4:
                    resu = "已完成~";
                    break;
                }
                sb.Append(resu);

                sb.Append("≌");
            }
            var info = new { PageData = Traditionalized(sb), TotalCount = count };

            context.Response.Write(JavaScriptConvert.SerializeObject(info));
        }
Example #28
0
 protected override void SetValue(string id)
 {
     cartast   = BLL.C_CarTast.GetModel(int.Parse(id));
     listcost  = BLL.C_CostDetalis.GetModelList(" CID=" + cartast.ID);
     cid.Value = id;
 }
Example #29
0
        protected override void SetValue(string id)
        {
            cartast  = BLL.C_CarTast.GetModel(int.Parse(id));
            supplier = BLL.C_Supplier.GetModel(int.Parse(cartast.SupplierName));

            cid.Value = id;
            if (!string.IsNullOrEmpty(cartast.OCode))
            {
                order   = BLL.Order.GetModel(cartast.OCode);
                listord = order.OrderDetail;
            }
            if (order != null)
            {
                listcost = BLL.C_CostDetalis.GetModelList(" CID=" + order.Id);
            }
            if (cartast.TState == 1 || !TModel.Role.SiJi)
            {
                anbtn.Visible = false;
            }

            Model.Member zm = BLL.Member.GetModelByMID(cartast.CarSJ1);
            if (zm != null)
            {
                zhusiji = zm.MName;
            }
            Model.Member fm = BLL.Member.GetModelByMID(cartast.CarSJ2);
            if (fm != null)
            {
                fusiji = fm.MName;
            }

            //装车信息
            if (cartast.TType != 1)
            {
                xcView.Visible = false;
                tcode          = cartast.TCode;
                CTModel        = BLL.C_CarTast.GetModelname(tcode);
                if (CTModel != null)
                {
                    SuppModel = BLL.C_Supplier.GetModel(Convert.ToInt32(CTModel.SupplierName));
                    if (!string.IsNullOrEmpty(CTModel.OCode))
                    {
                        OdModel = BLL.OrderDetail.GetList(" ordercode='" + CTModel.OCode + "'; ").FirstOrDefault();
                        Good    = BLL.Goods.GetModel(OdModel.GId);
                    }
                }
            }
            else
            {
                zcView.Visible = false;
                List <Model.C_CarTast> carList = BLL.C_CarTast.GetModelList(" TCode='" + cartast.Name + "' ");
                foreach (var item in carList)
                {
                    CarTast cModel = new CarTast();
                    cModel.Code = item.Name;
                    cModel.Supp = BLL.C_Supplier.GetModel(Convert.ToInt32(item.SupplierName)).Name;
                    Model.OrderDetail XCod = BLL.OrderDetail.GetModelCode(item.OCode);
                    if (XCod != null)
                    {
                        cModel.Count    = XCod.GCount;
                        cModel.ReCount  = XCod.ReCount;
                        cModel.GoodName = BLL.Goods.GetModel(Convert.ToInt32(XCod.GId)).GName;
                    }
                    cModel.CreateTime = item.CreateDate;
                    XCList.Add(cModel);
                }
            }
        }
Example #30
0
        protected override string btnAdd_Click()
        {
            lock (obj)
            {
                Model.C_CarTast cartast      = BLL.C_CarTast.GetModel(int.Parse(Request.Form["cid"]));
                decimal         retotalMoney = 0;//实际总额
                if (cartast.TState == 1)
                {
                    return("状态已改变,请勿重复提交");
                }
                cartast.TState = 1;

                decimal recount = 0;
                decimal reprice = 0;

                if (cartast.TType == 1 || cartast.TType == 2)
                {
                    if (string.IsNullOrEmpty(cartast.BDImg))
                    {
                        return("请上传磅单图片");
                    }


                    List <Model.OrderDetail> listord2 = null;
                    if (!string.IsNullOrEmpty(cartast.OCode))
                    {
                        order    = BLL.Order.GetModel(cartast.OCode);
                        listord2 = order.OrderDetail;
                        Model.OrderDetail od = BLL.OrderDetail.GetModelCode(cartast.OCode);
                        if (od != null)
                        {
                            retotalMoney = od.ReCount * od.BuyPrice;
                            recount      = od.ReCount;
                            reprice      = od.BuyPrice;
                        }
                    }
                    //if (listord2.Sum(m => m.ReCount) <= 0)
                    //	return "未查询到实际装车/卸车数量,不能完成";
                }
                Hashtable   MyHs = new Hashtable();
                Model.C_Car c1   = BLL.C_Car.GetModelByCode(cartast.Spare2);
                c1.Spare1 = "";
                BLL.C_Car.Update(c1, MyHs);
                Model.C_Car c2 = BLL.C_Car.GetModelByCode(cartast.CSpare2);
                if (c2 != null)
                {
                    c2.Spare1 = "";
                    BLL.C_Car.Update(c2, MyHs);
                }
                BLL.C_CarTast.Update(cartast, MyHs);

                if (cartast.TType == 1 || cartast.TType == 2)
                {
                    Model.Account acc = new Model.Account();
                    acc.CID          = cartast.ID;
                    acc.CName        = cartast.Name;
                    acc.AType        = cartast.TType == 1 ? 0 : 1;
                    acc.SupplierID   = Convert.ToInt32(cartast.SupplierName);
                    supplier         = BLL.C_Supplier.GetModel(int.Parse(cartast.SupplierName));
                    acc.SupplierName = supplier.Name;
                    acc.TotalMoney   = retotalMoney;
                    acc.ReMoney      = 0;
                    acc.CreateDate   = DateTime.Now;
                    acc.AStutas      = 0;
                    acc.comDate      = DateTime.MaxValue;
                    acc.OrderCount   = recount;
                    acc.OrderPrice   = reprice;

                    BLL.Account.Add(acc, MyHs);
                }


                if (BLL.CommonBase.RunHashtable(MyHs))
                {
                    return("结束任务成功");
                }
                else
                {
                    return("数据有误,结束任务失败");
                }
            }
        }