Beispiel #1
0
        public void Save(T_CPLXModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    result = T_CPLXDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = T_CPLXDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.LXID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_CPLX/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Beispiel #2
0
        public ActionResult Index(T_CPLXModels evalModel)
        {
            try
            {
                evalModel.currentPage = int.Parse(Request["pageNum"].ToString());
            }
            catch { }
            string order = "";

            try
            {
                order = Request["orderField"].ToString();
            }
            catch { }

            if (order.Trim() == "${param.orderField}")
            {
                order = "";
            }
            int pagesize    = Convert.ToInt32(evalModel.pageSize);
            int pagecount   = Convert.ToInt32(evalModel.pagecount);
            int currentPage = Convert.ToInt32(evalModel.currentPage);

            evalModel.DataModel   = evalModel.DataModel ?? new T_CPLX();
            evalModel.DataList    = T_CPLXDomain.GetInstance().PageT_CPLX(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_CPLX/Index.cshtml", evalModel));
        }
Beispiel #3
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_YLCPModels model = new T_YLCPModels();

            CurUser = Session["UserModel"] as SysUser;

            //加载批发商企业列表
            T_SupQYModels supQymode = new T_SupQYModels();

            supQymode.DataModel = supQymode.DataModel ?? new T_SupQY();

            supQymode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(supQymode.DataModel).Where(p => p.SupStatus == Convert.ToInt32("1")).ToList();

            ViewData["SUPQY"] = new SelectList(supQymode.DataList, "SupID", "SupMC", "请选择");

            //加载产品类型列表
            T_CPLXModels cplxQymode = new T_CPLXModels();

            cplxQymode.DataModel = cplxQymode.DataModel ?? new T_CPLX();

            cplxQymode.DataList = T_CPLXDomain.GetInstance().GetAllT_CPLX(cplxQymode.DataModel);

            ViewData["CPLX"] = new SelectList(cplxQymode.DataList, "LXID", "LXMC", "请选择");

            //加载仓库列表
            T_CKModels ckmode = new T_CKModels();

            ckmode.DataModel = ckmode.DataModel ?? new T_CK();

            ckmode.DataList = T_CKDomain.GetInstance().GetAllT_CK(ckmode.DataModel);

            ViewData["CK"] = new SelectList(ckmode.DataList, "CKID", "CKMC");

            model.DataModel = new T_YLCP();

            model.DataModel.CPLRRQ = DateTime.Now;
            model.DataModel.CPLRR  = CurUser.UserAccount;
            if (id != 0)
            {
                model.DataModel  = T_YLCPDomain.GetInstance().GetModelById(id);
                model.YLCPZZList = T_YLCPZZDomain.GetInstance().GetCPZZByCpid(id);
            }
            else
            {
                model.DataModel.CPBH = T_YLCPDomain.GetInstance().GetCpOrderNum("CP", CurUser);
            }
            Expression <Func <T_PackingUnit, bool> > where = PredicateBuilder.True <T_PackingUnit>();
            var lstUnit = T_PackingUnitDomain.GetInstance().GetAllModels <int>(where);

            ViewBag.PUnit  = new SelectList(lstUnit, "PUName", "PUName");
            model.Tag      = tag;
            model.RoleCode = GetRoleCode();
            return(View("~/Views/T_YLCP/Save.cshtml", model));
        }
Beispiel #4
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_CPLXModels model = new T_CPLXModels();

            model.DataModel = new T_CPLX();
            if (id != 0)
            {
                model.DataModel = T_CPLXDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            return(View("~/Views/T_CPLX/Save.cshtml", model));
        }
Beispiel #5
0
        public void Delete(System.Int32 id)
        {
            Expression <Func <T_YLCP, bool> > where = p => p.CPLXID == id;
            var list = T_YLCPDomain.GetInstance().GetAllModels <int>(where);

            if (list != null && list.Count > 0)
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"该类型下已有产品,不能删除!\"}");
                return;
            }
            int result = T_CPLXDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/T_CPLX/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Beispiel #6
0
        public ActionResult CPAuditIndex(System.Int32 id, string tag)
        {
            T_YLCPModels model = new T_YLCPModels();

            CurUser = Session["UserModel"] as SysUser;
            //加载批发商企业列表
            T_SupQYModels supQymode = new T_SupQYModels();

            supQymode.DataModel = supQymode.DataModel ?? new T_SupQY();

            supQymode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(supQymode.DataModel);

            ViewData["SUPQY"] = new SelectList(supQymode.DataList, "SupID", "SupMC", "请选择");

            //加载产品类型列表
            T_CPLXModels cplxQymode = new T_CPLXModels();

            cplxQymode.DataModel = cplxQymode.DataModel ?? new T_CPLX();

            cplxQymode.DataList = T_CPLXDomain.GetInstance().GetAllT_CPLX(cplxQymode.DataModel);

            ViewData["CPLX"] = new SelectList(cplxQymode.DataList, "LXID", "LXMC", "请选择");

            model.DataModel = new T_YLCP();

            model.DataModel.CPLRRQ = DateTime.Now;
            model.DataModel.CPLRR  = CurUser.UserAccount;
            if (id != 0)
            {
                model.DataModel    = T_YLCPDomain.GetInstance().GetModelById(id);
                ViewData["CPTPLJ"] = model.DataModel.CPTP;
                ViewData["CPFJLJ"] = model.DataModel.CPFJ;
            }
            model.Tag = tag;
            return(View("~/Views/T_YLCP/CPAuditIndex.cshtml", model));
        }