Beispiel #1
0
        public ActionResult ParamSetting()
        {
            PDAParam param = PDAParam.GetEntityByID(1);

            ViewBag.Param = param;
            return(View());
        }
Beispiel #2
0
        public RequestResult Get()
        {
            RequestResult result = new RequestResult();

            try
            {
                PDAParam param = PDAParam.GetEntityByID(1);
                List <PDAUserFuncEasy> UserFunc  = PDAUserFunc.GetEntitysUserId(PdaUser.ID);
                PDAParamEasy           paramEasy = new PDAParamEasy();
                paramEasy.IntoWay        = param.IntoWay;
                paramEasy.IsIntoProduct  = param.IsIntoProduct;
                paramEasy.IsIntoSupplier = param.IsIntoSupplier;
                paramEasy.IsLinkProduct  = param.IsLinkProduct;
                paramEasy.IsLinkSupplier = param.IsLinkSupplier;
                paramEasy.LinkWay        = param.LinkWay;
                paramEasy.OutWay         = param.OutWay;
                paramEasy.IsOutProduct   = param.IsOutProduct;
                paramEasy.MiddlePacking  = param.MiddlePacking || param.BigInto || param.BigOut;

                if (!paramEasy.MiddlePacking)
                {
                    for (int i = 0; i < UserFunc.Count(); i++)
                    {
                        switch (UserFunc[i].FunCode)
                        {
                        case "B004":
                            UserFunc[i].FunName = "大标入库";
                            break;

                        case "B007":
                            UserFunc[i].FunName = "大标出货";
                            break;

                        case "B010":
                            UserFunc[i].FunName = "大标退货";
                            break;
                        }
                    }
                }

                MobileBaseParamter BaseParam = new MobileBaseParamter();
                BaseParam.Param    = paramEasy;
                BaseParam.FuncList = UserFunc;

                result.data    = BaseParam;
                result.message = "成功";
                result.success = true;
            }
            catch (Exception ex)
            {
                result.code    = 500;
                result.message = "服务出错";
                result.success = false;
                DAL.Log.Instance.Write("获取PDA基础参数出错:" + ex.Message, "PDA上传出错");
            }

            return(result);
        }
Beispiel #3
0
        public ActionResult Index()
        {
            List <PDA> p = PDA.GetEntitysAllMore();

            PDAParam param = PDAParam.GetEntityByID(1);

            if (CurrentUser.UserName == WeConfig.robot)
            {
                ViewData["ss"] = "显示";
            }
            else
            {
                ViewData["ss"] = "隐藏";
            }

            ViewBag.Param = param;

            return(View(p));
        }
Beispiel #4
0
        public ContentResult SaveParam(FormCollection paramFrm)
        {
            PDAParam param = PDAParam.GetEntityByID(1);

            param.ScanProcess = paramFrm["ScanProcess"] != null?int.Parse(paramFrm["ScanProcess"]) : 0;

            param.IsLink        = paramFrm["IsLink"] != null && paramFrm["IsLink"].ToString() == "on" ? true : false;
            param.IsInto        = paramFrm["IsInto"] != null && paramFrm["IsInto"].ToString() == "on" ? true : false;
            param.IsOut         = paramFrm["IsOut"] != null && paramFrm["IsOut"].ToString() == "on" ? true : false;
            param.IsRtn         = paramFrm["IsRtn"] != null && paramFrm["IsRtn"].ToString() == "on" ? true : false;
            param.SmallPacking  = paramFrm["SmallPacking"] != null && paramFrm["SmallPacking"].ToString() == "on" ? true : false;
            param.MiddlePacking = paramFrm["MiddlePacking"] != null && paramFrm["MiddlePacking"].ToString() == "on" ? true : false;
            param.LinkWay       = paramFrm["LinkWay"] != null?int.Parse(paramFrm["LinkWay"]) : 0;

            param.IsLinkProduct  = paramFrm["IsLinkProduct"] != null && paramFrm["IsLinkProduct"].ToString() == "on" ? true : false;
            param.IsLinkSupplier = paramFrm["IsLinkSupplier"] != null && paramFrm["IsLinkSupplier"].ToString() == "on" ? true : false;
            param.SmallInto      = paramFrm["SmallInto"] != null && paramFrm["SmallInto"].ToString() == "on" ? true : false;
            param.MiddleInto     = paramFrm["MiddleInto"] != null && paramFrm["MiddleInto"].ToString() == "on" ? true : false;
            param.BigInto        = paramFrm["BigInto"] != null && paramFrm["BigInto"].ToString() == "on" ? true : false;
            param.IntoWay        = paramFrm["IntoWay"] != null?int.Parse(paramFrm["IntoWay"]) : 0;

            param.IsIntoProduct  = paramFrm["IsIntoProduct"] != null && paramFrm["IsIntoProduct"].ToString() == "on" ? true : false;
            param.IsIntoSupplier = paramFrm["IsIntoSupplier"] != null && paramFrm["IsIntoSupplier"].ToString() == "on" ? true : false;
            param.SmallOut       = paramFrm["SmallOut"] != null && paramFrm["SmallOut"].ToString() == "on" ? true : false;
            param.MiddleOut      = paramFrm["MiddleOut"] != null && paramFrm["MiddleOut"].ToString() == "on" ? true : false;
            param.BigOut         = paramFrm["BigOut"] != null && paramFrm["BigOut"].ToString() == "on" ? true : false;
            param.OutWay         = paramFrm["OutWay"] != null?int.Parse(paramFrm["OutWay"]) : 0;

            param.OrderRtn     = paramFrm["OrderRtn"] != null && paramFrm["OrderRtn"].ToString() == "on" ? true : false;
            param.SmallRtn     = paramFrm["SmallRtn"] != null && paramFrm["SmallRtn"].ToString() == "on" ? true : false;
            param.MiddleRtn    = paramFrm["MiddleRtn"] != null && paramFrm["MiddleRtn"].ToString() == "on" ? true : false;
            param.BigRtn       = paramFrm["BigRtn"] != null && paramFrm["BigRtn"].ToString() == "on" ? true : false;
            param.IsOutProduct = paramFrm["IsOutProduct"] != null && paramFrm["IsOutProduct"].ToString() == "on" ? true : false;

            param.UpdateByID();

            WeModels.PDAUserMsg.InitPDASystemParam(); // 更新缓存参数

            string DisabledFuncCode = "";
            string EnableFuncCode   = "";

            #region 功能代码禁用启用
            if (param.IsLink)
            {
                EnableFuncCode += ",'A001'"; EnableFuncCode += ",'A006'";
            }
            else
            {
                DisabledFuncCode += ",'A001'"; DisabledFuncCode += ",'A006'";
            }

            if (param.IsInto)
            {
                EnableFuncCode += ",'A002'";
            }
            else
            {
                DisabledFuncCode += ",'A002'";
            }

            if (param.IsOut)
            {
                EnableFuncCode += ",'A003'";
            }
            else
            {
                DisabledFuncCode += ",'A003'";
            }

            if (param.IsRtn)
            {
                EnableFuncCode += ",'A004'";
            }
            else
            {
                DisabledFuncCode += ",'A004'";
            }

            if (param.SmallPacking)
            {
                EnableFuncCode += ",'B001'"; EnableFuncCode += ",'B013'";
            }
            else
            {
                DisabledFuncCode += ",'B001'"; DisabledFuncCode += ",'B013'";
            }

            if (param.MiddlePacking)
            {
                EnableFuncCode += ",'B002'"; EnableFuncCode += ",'B014'";
            }
            else
            {
                DisabledFuncCode += ",'B002'"; DisabledFuncCode += ",'B014'";
            }

            if (param.SmallInto)
            {
                EnableFuncCode += ",'B003'";
            }
            else
            {
                DisabledFuncCode += ",'B003'";
            }

            if (param.MiddleInto)
            {
                EnableFuncCode += ",'B004'";
            }
            else
            {
                DisabledFuncCode += ",'B004'";
            }

            if (param.BigInto)
            {
                EnableFuncCode += ",'B005'";
            }
            else
            {
                DisabledFuncCode += ",'B005'";
            }

            if (param.SmallOut)
            {
                EnableFuncCode += ",'B006'";
            }
            else
            {
                DisabledFuncCode += ",'B006'";
            }

            if (param.MiddleOut)
            {
                EnableFuncCode += ",'B007'";
            }
            else
            {
                DisabledFuncCode += ",'B007'";
            }

            if (param.BigOut)
            {
                EnableFuncCode += ",'B008'";
            }
            else
            {
                DisabledFuncCode += ",'B008'";
            }

            if (param.SmallRtn)
            {
                EnableFuncCode += ",'B009'";
            }
            else
            {
                DisabledFuncCode += ",'B009'";
            }

            if (param.MiddleRtn)
            {
                EnableFuncCode += ",'B010'";
            }
            else
            {
                DisabledFuncCode += ",'B010'";
            }

            if (param.BigRtn)
            {
                EnableFuncCode += ",'B011'";
            }
            else
            {
                DisabledFuncCode += ",'B011'";
            }

            #endregion

            if (DisabledFuncCode != "" && DisabledFuncCode.Length > 4)
            {
                DisabledFuncCode = DisabledFuncCode.Substring(1, DisabledFuncCode.Length - 1);
                PDAFuntion.SetDisabledFunc(DisabledFuncCode);
            }

            if (EnableFuncCode != "" && EnableFuncCode.Length > 4)
            {
                EnableFuncCode = EnableFuncCode.Substring(1, EnableFuncCode.Length - 1);
                PDAFuntion.SetEnableFunc(EnableFuncCode);
            }

            return(Content("ok"));
        }
Beispiel #5
0
 public StartEvent()
 {
     PDAUserMsg.Param = PDAParam.GetEntityByID(1);
 }