Example #1
0
        public JsonResult GetYLCP(string cpid)
        {
            T_YLCP cp = T_YLCPDomain.GetInstance().GetModelById(Convert.ToInt32(cpid));

            if (cp != null)
            {
                string scqyMc = "";
                if (cp.CPSCQYID.HasValue)
                {
                    var scqy = T_SupQYDomain.GetInstance().GetModelById(cp.CPSCQYID);
                    if (scqy != null && !string.IsNullOrEmpty(scqy.SupMC))
                    {
                        scqyMc = scqy.SupMC;
                    }
                }

                string resultStr = JsonConvert.SerializeObject(new { CPGG = cp.CPGG, CPPrice = cp.CPPrice, CPDW = cp.CPDW, SCQYMC = scqyMc, SCQYID = cp.CPSCQYID });
                //string str = "{\"CPGG\":\"" + cp.CPGG + "\"}";
                return(Json(resultStr));
            }
            else
            {
                return(Json(""));
            }
        }
Example #2
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            //加载购买商商企业列表
            //T_CGDModels cgdQymode = new T_CGDModels();

            //cgdQymode.DataModel = cgdQymode.DataModel ?? new T_CGD();

            //cgdQymode.DataList = T_CGDDomain.GetInstance().GetAllT_CGD(cgdQymode.DataModel);

            //ViewData["CGD"] = new SelectList(cgdQymode.DataList, "CGID", "CGDMC");

            //加载企业列表
            T_SupQYModels supmode = new T_SupQYModels();

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

            supmode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();

            ViewData["SupID"] = new SelectList(supmode.DataList, "SupID", "SupMC");

            T_HTModels model = new T_HTModels();

            model.DataModel = new T_HT();
            if (id != 0)
            {
                model.DataModel = T_HTDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            return(View("~/Views/T_HT/Save.cshtml", model));
        }
Example #3
0
        public void Save(T_SupQYModels model)
        {
            int result = 0;

            try
            {
                loginUser             = Session["UserModel"] as SysUser;
                model.DataModel.WhsID = loginUser.UserCompanyID ?? 0;
                if (model.Tag == "Add")
                {
                    model.DataModel.SupStatus = 0;
                    result = T_SupQYDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    model.DataModel.SupStatus = 0;
                    result = T_SupQYDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.SupID);
                }
                //企业资质操作
                T_SupQYDomain.GetInstance().OperQyzz(model.DataModel.SupID, model.QYZZFiles);
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_SupQY/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Example #4
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            //加载企业列表
            T_SupQYModels supmode = new T_SupQYModels();

            supmode.DataModel = supmode.DataModel ?? new T_SupQY();
            supmode.DataList  = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();
            ViewData["SupID"] = new SelectList(supmode.DataList, "SupID", "SupMC");

            Expression <Func <T_YSD, bool> > where = PredicateBuilder.True <T_YSD>();
            where = where.And(p => p.IsTHFinish != 1);
            var yslist = T_YSDDomain.GetInstance().GetAllModels <int>(where);

            ViewData["YSD"] = new SelectList(yslist, "YSID", "YSDH");

            T_THDModels model = new T_THDModels();

            model.DataModel = new T_THD();
            var CurUser = Session["UserModel"] as SysUser;
            //获取本企业下的人员列表
            T_Person person = new T_Person();

            if (CurUser.UserCompanyID != null)
            {
                person.PsQYID = (int)CurUser.UserCompanyID;
            }
            ViewBag.Persons = new SelectList(T_PersonDomain.GetInstance().GetAllT_Person(person), "PsMZ", "PsMZ");

            //加载仓库列表
            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");

            if (id != 0)
            {
                model.DataModel = T_THDDomain.GetInstance().GetModelById(id);
                model.THMXList  = T_THMXDomain.GetInstance().GetT_THMXByYsid(id);
                if (model.DataModel.YSID != null && model.DataModel.YSID != 0)
                {
                    var temp = T_YSDDomain.GetInstance().GetModelById(model.DataModel.YSID);
                    if (temp != null)
                    {
                        model.YSDH = temp.YSDH;
                    }
                }
            }
            else
            {
                model.DataModel.THDH   = T_THDDomain.GetInstance().GetTHOrderNum("TH", CurUser);
                model.DataModel.THCJR  = CurUser.UserAccount;
                model.DataModel.THCJRQ = DateTime.Now;
            }
            model.Tag      = tag;
            model.RoleCode = GetRoleCode();
            return(View("~/Views/T_THD/Save.cshtml", model));
        }
Example #5
0
        public ActionResult Index(T_YLCPModels evalModel)
        {
            try
            {
                SysUser UserModel = Session["UserModel"] as SysUser;
                ViewData["shUserId"]  = UserModel.UserId;
                evalModel.currentPage = int.Parse(Request["pageNum"].ToString());
            }
            catch { }
            string order = "";

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

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

            evalModel.DataModel = evalModel.DataModel ?? new T_YLCP();
            if (Request["strCPMC"] != null)
            {
                string str = Request["strCPMC"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.CPMC = str.Trim();
                }
                ViewData["strCPMC"] = str;
            }

            if (Request["strCPSCQY"] != null)
            {
                strscqy = Request["strCPSCQY"].ToString();
                if (!String.IsNullOrEmpty(strscqy))
                {
                    evalModel.DataModel.CPSCQYID = int.Parse(strscqy);
                }
            }
            var list = T_SupQYDomain.GetInstance().GetAllT_SupQY(new T_SupQY()
            {
                SupStatus = 1
            }).ToList();

            ViewBag.Persons       = new SelectList(list, "SupID", "SupMC", "请选择");
            ViewData["strCPSCQY"] = strscqy;
            evalModel.DataList    = T_YLCPDomain.GetInstance().PageT_YLCP(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_YLCP/Index.cshtml", evalModel));
        }
Example #6
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));
        }
Example #7
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_CGDModels model = new T_CGDModels();

            model.DataModel = new T_CGD();
            CurUser         = Session["UserModel"] as SysUser;
            //id是否为0,区分增加和修改功能
            if (id != 0)
            {
                model.CGMXList  = T_CGMXDomain.GetInstance().GetT_CGMXByCgid(id);
                model.DataModel = T_CGDDomain.GetInstance().GetModelById(id);
            }
            else
            {
                model.DataModel.CGDH   = T_CGDDomain.GetInstance().GetCgOrderNum("CP", CurUser);
                model.DataModel.CGCJR  = CurUser.UserAccount;
                model.DataModel.CGCJRQ = DateTime.Now;
            }

            //加载产品列表
            //T_YLCPModels ylcpmode = new T_YLCPModels();

            //ylcpmode.DataModel = ylcpmode.DataModel ?? new T_YLCP();

            //ylcpmode.DataList = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpmode.DataModel);

            //ViewData["YLCP"] = new SelectList(ylcpmode.DataList, "CPID", "CPMC");

            //加载企业列表
            T_SupQYModels supmode = new T_SupQYModels();

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

            supmode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();

            ViewData["SupID"] = new SelectList(supmode.DataList, "SupID", "SupMC");

            //获取用户信息(包含单位ID)
            SysUser UserModel = Session["UserModel"] as SysUser;
            //获取本企业下的人员列表
            T_Person person = new T_Person();

            if (UserModel.UserCompanyID != null)
            {
                person.PsQYID = (int)UserModel.UserCompanyID;
            }
            ViewBag.Persons = new SelectList(T_PersonDomain.GetInstance().GetAllT_Person(person), "PsMZ", "PsMZ");
            //Expression<Func<T_PackingUnit, bool>> where = PredicateBuilder.True<T_PackingUnit>();
            //ViewBag.PackingUnit = new SelectList(T_PackingUnitDomain.GetInstance().GetAllModels<int>(where), "PUName", "PUName");
            model.Tag      = tag;
            model.RoleCode = GetRoleCode();
            return(View("~/Views/T_CGD/Save.cshtml", model));
        }
Example #8
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_CGMXModels model = new T_CGMXModels();

            model.DataModel = new T_CGMX();
            Int32 did = id;

            if (tag != "Add")
            {
                model.DataModel = T_CGMXDomain.GetInstance().GetModelById(id);
                did             = model.DataModel.CGID;
            }

            //加载产品列表
            T_YLCPModels ylcpmode = new T_YLCPModels();

            ylcpmode.DataModel = ylcpmode.DataModel ?? new T_YLCP();

            ylcpmode.DataList = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpmode.DataModel);

            ViewData["YLCP"] = new SelectList(ylcpmode.DataList, "CPID", "CPMC");

            //加载企业列表
            T_SupQYModels supmode = new T_SupQYModels();

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

            supmode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();

            ViewData["SupID"] = new SelectList(supmode.DataList, "SupID", "SupMC");

            //加载采购单列表
            T_CGDModels cgdQymode = new T_CGDModels();

            cgdQymode.DataModel = cgdQymode.DataModel ?? new T_CGD();
            T_CGD cgd = T_CGDDomain.GetInstance().GetModelById(did);

            cgdQymode.DataList = new List <T_CGD>();
            cgdQymode.DataList.Add(cgd);
            ViewData["CGD"] = new SelectList(cgdQymode.DataList, "CGID", "CGDMC");



            //if (id != 0)
            //{
            //    model.DataModel = T_CGMXDomain.GetInstance().GetModelById(id);
            //}
            model.Tag = tag;
            return(View("~/Views/T_CGMX/Save.cshtml", model));
        }
Example #9
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            //加载验收单
            List <T_YSD> ysdList = new List <T_YSD>();

            ysdList         = T_YSDDomain.GetInstance().GetAllT_YSD(new T_YSD()).OrderByDescending(p => p.YSDH).ToList();
            ViewData["YSD"] = new SelectList(ysdList, "YSDH", "YSDH");

            //加载仓库列表
            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");

            //加载企业列表
            T_SupQYModels supmode = new T_SupQYModels();

            supmode.DataModel = supmode.DataModel ?? new T_SupQY();
            supmode.DataList  = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();
            ViewData["SupID"] = new SelectList(supmode.DataList, "SupID", "SupMC");


            T_RKDModels model = new T_RKDModels();

            model.DataModel = new T_RKD();
            CurUser         = Session["UserModel"] as SysUser;

            if (id != 0)
            {
                model.DataModel = T_RKDDomain.GetInstance().GetModelById(id);
                model.RKMXList  = T_RKMXDomain.GetInstance().GetT_RKMXByRkid(id);
            }
            else
            {
                model.DataModel.RKDH   = T_RKDDomain.GetInstance().GetRkOrderNum(CurUser);
                model.DataModel.RKCJR  = CurUser.UserAccount;
                model.DataModel.RKCJRQ = DateTime.Now;
            }

            //获取本企业下的人员列表
            T_Person person = new T_Person();

            person.PsQYID   = (int)CurUser.UserCompanyID;
            ViewBag.Persons = new SelectList(T_PersonDomain.GetInstance().GetAllT_Person(person), "PsMZ", "PsMZ");
            model.Tag       = tag;
            model.RoleCode  = GetRoleCode();
            return(View("~/Views/T_RKD/Save.cshtml", model));
        }
Example #10
0
        public JsonResult GetInfoByID(System.Int32 id)
        {
            var result = new T_SupQY();
            var str    = "";

            if (id != 0)
            {
                result = T_SupQYDomain.GetInstance().GetModelById(id);
                str    = JsonConvert.SerializeObject(new
                {
                    SCAddr = result.SCAddr
                });
            }
            return(Json(str));
        }
Example #11
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            SysUser sysUser = Session["UserModel"] as SysUser;
            //采购单列表
            T_CGDModels cgdQymode = new T_CGDModels();

            cgdQymode.DataModel = cgdQymode.DataModel ?? new T_CGD();
            //cgdQymode.DataList = T_CGDDomain.GetInstance().GetAllT_CGD(cgdQymode.DataModel).Where(p => p.ISSH == 1 && p.IsFinish == 0).OrderByDescending(p => p.CGDH).ToList();
            cgdQymode.DataList = T_CGDDomain.GetInstance().GetAllT_CGD(cgdQymode.DataModel).Where(p => p.ISSH == 1 && p.IsFinish != 1).OrderByDescending(p => p.CGDH).ToList();
            ViewData["CGD"]    = new SelectList(cgdQymode.DataList, "CGDH", "CGDH");

            //加载企业列表
            T_SupQYModels supmode = new T_SupQYModels();

            supmode.DataModel = supmode.DataModel ?? new T_SupQY();
            supmode.DataList  = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();
            ViewData["SupID"] = new SelectList(supmode.DataList, "SupID", "SupMC");

            //获取本企业下的人员列表
            T_Person person = new T_Person();

            person.PsQYID   = (int)sysUser.UserCompanyID;
            ViewBag.Persons = new SelectList(T_PersonDomain.GetInstance().GetAllT_Person(person), "PsMZ", "PsMZ");

            T_YSDModels model = new T_YSDModels();

            model.DataModel = new T_YSD();
            if (id != 0)
            {
                model.DataModel = T_YSDDomain.GetInstance().GetModelById(id);
                model.YSMXList  = T_YSMXDomain.GetInstance().GetT_YSMXByYsid(id);
            }
            else
            {
                model.DataModel.YSDH   = T_YSDDomain.GetInstance().GetYsOrderNum("YS", sysUser);
                model.DataModel.YSCJR  = sysUser.UserAccount;
                model.DataModel.YSCJRQ = DateTime.Now;
            }


            model.Tag      = tag;
            model.RoleCode = GetRoleCode();
            return(View("~/Views/T_YSD/Save.cshtml", model));
        }
Example #12
0
        public ActionResult AuditIndex(System.Int32 id, string tag)
        {
            T_SupQYModels model = new T_SupQYModels();

            model.DataModel = new T_SupQY();
            T_QYZZ zzmodel = new T_QYZZ();

            if (id != 0)
            {
                model.DataModel = T_SupQYDomain.GetInstance().GetModelById(id);
                model.QYZZList  = T_QYZZDomain.GetInstance().GetAllT_QYZZ(zzmodel);
                if (model.QYZZList.Count > 0)
                {
                    model.QYZZList = model.QYZZList.Where(p => p.QYID == id).ToList();
                }
            }
            model.Tag = tag;
            return(View("~/Views/T_SupQY/AuditIndex.cshtml", model));
        }
Example #13
0
        public ActionResult HTSPIndex(System.Int32 id, string tag)
        {
            T_HTModels model = new T_HTModels();

            model.DataModel = new T_HT();
            if (id != 0)
            {
                model.DataModel = T_HTDomain.GetInstance().GetModelById(id);
                //加载企业列表
                T_SupQYModels supmode = new T_SupQYModels();

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

                supmode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();

                ViewData["SupID"] = new SelectList(supmode.DataList, "SupID", "SupMC");
            }
            model.Tag = tag;
            return(View("~/Views/T_HT/HTSPIndex.cshtml", model));
        }
Example #14
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_SupQYModels model = new T_SupQYModels();

            model.DataModel = new T_SupQY();
            if (id != 0)
            {
                model.DataModel = T_SupQYDomain.GetInstance().GetModelById(id);
                model.QYZZList  = T_QYZZDomain.GetInstance().GetQYZZByQyid(id);
            }
            //经营范围(下)
            T_JYFWModels jyfwmodels = new T_JYFWModels();

            jyfwmodels.DataModel = jyfwmodels.DataModel ?? new T_JYFW();
            model.JYFWList       = T_JYFWDomain.GetInstance().GetAllT_JYFW(jyfwmodels.DataModel).ToList();

            model.Tag      = tag;
            model.RoleCode = GetRoleCode();
            return(View("~/Views/T_SupQY/Save.cshtml", model));
        }
Example #15
0
        public void through(T_SupQYModels model, int id)
        {
            int result = 0;

            try
            {
                Int32 supqyid = model.DataModel.SupID;
                result = T_SupQYDomain.GetInstance().Sh(supqyid, id);
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_SupQY/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Example #16
0
        public void Delete(System.Int32 id)
        {
            //var rCode = GetRoleCode();
            //if (rCode != "1")
            //{
            var temp = T_SupQYDomain.GetInstance().GetModelById(id);

            if (temp != null && (temp.SupStatus == 1))
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"已审批通过的数据不能删除!\"}");
                return;
            }
            //}
            Expression <Func <T_YLCP, bool> > where = p => (p.CPGYSID == id || p.CPSCQYID == id);
            var list = T_YLCPDomain.GetInstance().GetAllModels <int>(where);

            if (list != null && list.Count > 0)
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"该企业下已有产品,不能删除!\"}");
                return;
            }
            Expression <Func <T_CGMX, bool> > whereCGD = p => (p.SupID == id || p.CPSCQYID == id);
            var lstCGMX = T_CGMXDomain.GetInstance().GetAllModels <int>(whereCGD);

            if (lstCGMX != null && lstCGMX.Count > 0)
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"该企业下已有采购单,不能删除!\"}");
                return;
            }
            int result = T_SupQYDomain.GetInstance().Delete(id);

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

            //加载批发商企业列表
            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", "请选择");

            model.DataModel = new T_QYZZ();
            if (id != 0)
            {
                model.DataModel = T_QYZZDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            return(View("~/Views/T_QYZZ/Save.cshtml", model));
        }
Example #18
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));
        }
Example #19
0
        public ActionResult Index(T_KCModels evalModel)
        {
            try
            {
                evalModel.currentPage = int.Parse(Request["pageNum"].ToString());
            }
            catch { }
            string ckid  = "";
            string qyid  = "";
            string cpid  = "";
            string order = "";

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

            if (order.Trim() == "${param.orderField}")
            {
                order = "";
            }

            //加载购买商商企业列表
            T_YLCPModels ylcpQymode = new T_YLCPModels();

            ylcpQymode.DataModel = ylcpQymode.DataModel ?? new T_YLCP();

            ylcpQymode.DataList = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpQymode.DataModel).Where(p => p.CPStatus == Convert.ToInt32("1")).ToList();

            ViewData["YLCP"] = new SelectList(ylcpQymode.DataList, "CPID", "CPMC");

            //加载购买商商企业列表
            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");

            //加载产品生产企业
            T_SupQYModels qymode = new T_SupQYModels();

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

            qymode.DataList = T_SupQYDomain.GetInstance().GetAllT_SupQY(qymode.DataModel).Where(p => p.SupStatus == 1).ToList();
            ViewData["QY"]  = new SelectList(qymode.DataList, "SupID", "SupMC");


            int pagesize    = Convert.ToInt32(evalModel.pageSize);
            int pagecount   = Convert.ToInt32(evalModel.pagecount);
            int currentPage = Convert.ToInt32(evalModel.currentPage);

            evalModel.DataModel = evalModel.DataModel ?? new T_KC();
            if (Request["CKList"] != null)
            {
                ckid = Request["CKList"].ToString();
                if (!String.IsNullOrEmpty(ckid))
                {
                    evalModel.DataModel.CKID = Convert.ToInt16(ckid);
                }
            }

            if (Request["CPList"] != null)
            {
                cpid = Request["CPList"].ToString();
                if (!String.IsNullOrEmpty(cpid))
                {
                    evalModel.DataModel.CPID = Convert.ToInt16(cpid);
                }
            }
            if (Request["QYList"] != null)
            {
                qyid = Request["QYList"].ToString();
                if (!String.IsNullOrEmpty(qyid))
                {
                    evalModel.DataModel.ScqyID = Convert.ToInt16(qyid);
                }
            }
            var supid = "";

            if (Request["strKCSupQY"] != null)
            {
                supid = Request["strKCSupQY"].ToString();
                if (!String.IsNullOrEmpty(supid))
                {
                    evalModel.DataModel.SupID = Convert.ToInt16(supid);
                }
            }

            ViewData["CKList"]     = ckid;
            ViewData["CPList"]     = cpid;
            ViewData["QYList"]     = qyid;
            ViewData["strKCSupQY"] = supid;
            evalModel.DataList     = T_KCDomain.GetInstance().PageT_KC(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount  = resultCount;
            return(View("~/Views/T_KC/Index.cshtml", evalModel));
        }
Example #20
0
        public ActionResult Index(T_CKDModels 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_CKD();

            if (Request["strCKDName"] != null)  //出库单号
            {
                string str = Request["strCKDName"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.CKDH = str.Trim();
                }
                ViewData["strCKDName"] = str;
            }
            if (Request["strCKDMC"] != null)  //出库单名称
            {
                string str = Request["strCKDMC"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.CKMC = str.Trim();
                }
            }
            var ghId = 0;

            if (Request["strCKDGHQY"] != null)
            {
                var str = Request["strCKDGHQY"].ToString();
                if (!string.IsNullOrEmpty(str))
                {
                    ghId = Convert.ToInt32(str);
                }
                ViewData["strCKDGHQY"] = str;
            }
            var cpId = 0;  //产品名称

            if (Request["strCKDCPMC"] != null)
            {
                string str = Request["strCKDCPMC"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    cpId = Convert.ToInt32(str);
                }
                ViewData["strCKDCPMC"] = str;
            }
            var scId = 0; //生产企业ID

            if (Request["strCKDSCQY"] != null)
            {
                string str = Request["strCKDSCQY"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    scId = Convert.ToInt32(str);
                }
                ViewData["strCKDSCQY"] = str;
            }

            //购货企业列表
            T_CusQY cusqy = new T_CusQY();

            ViewBag.CUSQY = new SelectList(T_CusQYDomain.GetInstance().GetAllT_CusQY(cusqy).Where(p => p.CusStatus == 1).ToList(), "CusID", "CusMC");

            T_SupQYModels supmode = new T_SupQYModels();

            supmode.DataModel     = supmode.DataModel ?? new T_SupQY();
            supmode.DataList      = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();
            ViewData["SupQYList"] = new SelectList(supmode.DataList, "SupID", "SupMC");
            T_YLCPModels ylcpQymode = new T_YLCPModels();

            ylcpQymode.DataModel = ylcpQymode.DataModel ?? new T_YLCP();
            ylcpQymode.DataList  = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpQymode.DataModel).Where(p => p.CPStatus == 1).ToList();
            ViewData["YLCP"]     = new SelectList(ylcpQymode.DataList, "CPID", "CPMC");

            evalModel.DataList    = T_CKDDomain.GetInstance().PageT_CKD(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, cpId, scId, ghId, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_CKD/Index.cshtml", evalModel));
        }
Example #21
0
        public ActionResult Index(T_SupQYModels evalModel)
        {
            loginUser = Session["UserModel"] as SysUser;
            if (loginUser != null)
            {
                try
                {
                    //SysUser UserModel = Session["UserModel"] as SysUser;
                    ViewData["shUserId"] = loginUser.UserId;
                    if (Request["pageNum"] != null)
                    {
                        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_SupQY();

                if (Request["strSupMc"] != null)
                {
                    string str = Request["strSupMc"].ToString();
                    if (!String.IsNullOrEmpty(str))
                    {
                        evalModel.DataModel.SupMC = str;
                    }
                    ViewData["strSupMc"] = str;
                }
                string strQYLX = "--请选择--";
                if (Request["strQYLX"] != null)
                {
                    strQYLX = Request["strQYLX"].ToString();
                    if (!String.IsNullOrEmpty(strQYLX))
                    {
                        if (strQYLX != "--请选择--")
                        {
                            evalModel.DataModel.SupDWXZ = strQYLX;
                        }
                    }
                }
                string strSHZT = "--请选择--";
                if (Request["strSHZT"] != null)
                {
                    strSHZT = Request["strSHZT"].ToString();
                    if (!String.IsNullOrEmpty(strSHZT))
                    {
                        if (strSHZT == "未审批")
                        {
                            evalModel.DataModel.SupStatus = 0;
                        }
                        else if (strSHZT == "已审批")
                        {
                            evalModel.DataModel.SupStatus = 1;
                        }
                        else if (strSHZT == "审批未通过")
                        {
                            evalModel.DataModel.SupStatus = 2;
                        }
                    }
                }
                evalModel.DataModel.WhsID = loginUser.UserCompanyID ?? 0;

                evalModel.DataList    = T_SupQYDomain.GetInstance().PageT_SupQY(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
                evalModel.resultCount = resultCount;

                //企业类型
                string[] QYL = { "--请选择--", "国有企业", "集体企业", "股份合作企业", "有限责任公司", "联营企业", "中外合资经营企业", "中外合作经营企业", "其他有限责任公司分公司", "其他有限责任公司", "其他" };
                List <SelectListItem> QYlist = new List <SelectListItem>();
                foreach (string s in QYL)
                {
                    QYlist.Add(new SelectListItem {
                        Text = s, Value = s
                    });
                }
                ViewBag.QYLX        = new SelectList(QYlist, "Value", "Text");
                ViewData["strQYLX"] = strQYLX;

                //审核类型
                string[] SHLX = { "--请选择--", "未审批", "已审批", "审批未通过" };
                List <SelectListItem> SHlist = new List <SelectListItem>();
                foreach (string s in SHLX)
                {
                    SHlist.Add(new SelectListItem {
                        Text = s, Value = s
                    });
                }
                ViewBag.SHZT = new SelectList(SHlist, "Value", "Text");

                ViewData["strSHZT"] = strSHZT;
                return(View("~/Views/T_SupQY/Index.cshtml", evalModel));
            }
            else
            {
                return(RedirectToAction("Login", "WebMain"));
            }
        }
Example #22
0
        public ActionResult NCGIndex(T_YSDModels evalModel)
        {
            SysUser UserModel = Session["UserModel"] as SysUser;

            try
            {
                evalModel.currentPage = int.Parse(Request["pageNum"].ToString());
            }
            catch { }
            string order = "";

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

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

            evalModel.DataModel        = evalModel.DataModel ?? new T_YSD();
            evalModel.DataModel.IsCGYS = 1;

            if (Request["strYSPerson"] != null)
            {
                strYSPerson = Request["strYSPerson"].ToString();
                if (!String.IsNullOrEmpty(strYSPerson))
                {
                    evalModel.DataModel.YSR = strYSPerson;
                }
            }

            var cpId = 0;

            if (Request["strYSCPMC"] != null)
            {
                string str = Request["strYSCPMC"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    cpId = Convert.ToInt32(str);
                }
                ViewData["strYSCPMC"] = str;
            }
            var cusId = 0;

            if (Request["strCusQY"] != null)
            {
                string str = Request["strCusQY"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    cusId = Convert.ToInt32(str);
                }
                ViewData["strCusQY"] = str;
            }

            //获取本企业下的人员列表
            T_Person person = new T_Person();

            person.PsQYID           = (int)UserModel.UserCompanyID;
            ViewBag.Persons         = new SelectList(T_PersonDomain.GetInstance().GetAllT_Person(person), "PsMZ", "PsMZ");
            ViewData["strYSPerson"] = strYSPerson;

            T_YLCPModels ylcpQymode = new T_YLCPModels();

            ylcpQymode.DataModel = ylcpQymode.DataModel ?? new T_YLCP();
            ylcpQymode.DataList  = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpQymode.DataModel).Where(p => p.CPStatus == 1).ToList();
            ViewData["YLCP"]     = new SelectList(ylcpQymode.DataList, "CPID", "CPMC");

            T_SupQYModels supmode = new T_SupQYModels();

            supmode.DataModel     = supmode.DataModel ?? new T_SupQY();
            supmode.DataList      = T_SupQYDomain.GetInstance().GetAllT_SupQY(supmode.DataModel).Where(p => p.SupStatus == 1).ToList();
            ViewData["SupQYList"] = new SelectList(supmode.DataList, "SupID", "SupMC");

            evalModel.DataList    = T_YSDDomain.GetInstance().PageT_YSD(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, cpId, cusId, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_YSD/NCGIndex.cshtml", evalModel));
        }
Example #23
0
        public int resultCount = 0; // 总条数
        // GET: T_XSHZ
        public ActionResult Index(T_XSMXModels evalModel)
        {
            try
            {
                evalModel.currentPage = int.Parse(Request["pageNum"].ToString());
            }
            catch { }
            string order = "";
            string qyid  = "";

            try
            {
                order = Request["orderField"].ToString();
            }
            catch { }
            if (order.Trim() == "${param.orderField}")
            {
                order = "";
            }
            evalModel.DataModel        = evalModel.DataModel ?? new T_XSMX();
            evalModel.DataModel.T_YLCP = evalModel.DataModel.T_YLCP ?? new T_YLCP();

            //加载产品生产企业
            T_SupQYModels qymode = new T_SupQYModels();

            qymode.DataModel = qymode.DataModel ?? new T_SupQY();
            qymode.DataList  = T_SupQYDomain.GetInstance().GetAllT_SupQY(qymode.DataModel);
            ViewData["QY"]   = new SelectList(qymode.DataList, "SupID", "SupMC");
            if (Request["QYList"] != null)
            {
                qyid = Request["QYList"].ToString();
                if (!String.IsNullOrEmpty(qyid))
                {
                    T_SupQY qycp = new T_SupQY();
                    qycp.SupID = int.Parse(qyid);
                    evalModel.DataModel.T_YLCP.T_SupQY1 = qycp;
                }
            }
            ViewData["QYList"] = qyid;

            Expression <Func <T_YLCP, bool> > where = PredicateBuilder.True <T_YLCP>();
            var lst = T_YLCPDomain.GetInstance().GetAllModels <int>(where);

            ViewData["XSHZ_YLCP"] = new SelectList(lst, "CPID", "CPMC");
            var cpid = "";

            if (Request["XSHZ_CPID"] != null)
            {
                cpid = Request["XSHZ_CPID"].ToString();
                if (!String.IsNullOrEmpty(cpid))
                {
                    evalModel.DataModel.CPID = int.Parse(cpid);
                }
            }
            ViewData["XSHZ_CPID"] = cpid;

            int pagesize    = Convert.ToInt32(evalModel.pageSize);
            int pagecount   = Convert.ToInt32(evalModel.pagecount);
            int currentPage = Convert.ToInt32(evalModel.currentPage);

            evalModel.DataModel   = evalModel.DataModel ?? new T_XSMX();
            evalModel.DataList    = T_XSMXDomain.GetInstance().PageT_XSMX(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;

            var totalNum = 0;

            if (evalModel.DataList != null && evalModel.DataList.Count > 0)
            {
                evalModel.DataList.ForEach(p =>
                {
                    totalNum += (p.CPSL ?? 0);
                });
            }
            ViewBag.TotalNum = totalNum;
            return(View("~/Views/T_XSHZ/Index.cshtml", evalModel));
        }
Example #24
0
        /// <summary>
        /// 获取提示信息
        /// </summary>
        public string GetTipInfo()
        {
            var strHtml = new StringBuilder();
            Expression <Func <ActivityInfo, bool> > whereActivityInfo = p => (p.EndTime != null && DateTime.Now <= p.EndTime.Value);

            whereActivityInfo = whereActivityInfo.And(p => p.StartTime != null && DateTime.Now >= p.StartTime.Value);
            var ActivityInfoCount = ActivityInfoDomain.GetInstance().GetAllModels <int>(whereActivityInfo).Count; //有效的公告数量

            var AlarmCount = T_BJDDomain.GetInstance().GetCount();                                                //报警数量

            if (AlarmCount > 0)
            {
                strHtml.Append(string.Format(strTemplete, "alarmManage", "/T_BJD/Index/", "预警通知", AlarmCount, "报警"));
            }
            if (ActivityInfoCount > 0)
            {
                strHtml.Append(string.Format(strTemplete, "ActivityInfoManage", "/ActivityInfo/Index/", "公告管理", ActivityInfoCount, "公告"));
            }
            var RoleCode = GetRoleCode();

            if (RoleCode == "2")
            {
                #region
                Expression <Func <T_SupQY, bool> > whereSupQY = p => p.SupStatus == 0;
                var SupQYCount = T_SupQYDomain.GetInstance().GetAllModels <int>(whereSupQY).Count; //待审批的供货企业数量

                Expression <Func <T_YLCP, bool> > whereYLCP = p => p.CPStatus == 0;
                var YLCPCount = T_YLCPDomain.GetInstance().GetAllModels <int>(whereYLCP).Count; //待审批的医疗产品数量

                Expression <Func <T_CusQY, bool> > whereCusQY = p => p.CusStatus == 0;
                var CusQYCount = T_CusQYDomain.GetInstance().GetAllModels <int>(whereCusQY).Count; //待审批的购货企业数量

                Expression <Func <T_CGD, bool> > whereCGD = p => p.ISSH == 0;
                var CGDCount = T_CGDDomain.GetInstance().GetAllModels <int>(whereCGD).Count; //待审批的采购单数量

                Expression <Func <T_RKD, bool> > whereRKD = p => p.ISSH == 0;
                var RKDCount = T_RKDDomain.GetInstance().GetAllModels <int>(whereRKD).Count; //待审批的入库单数量

                Expression <Func <T_XSD, bool> > whereXSD = p => p.XSFLAG == 0;
                var XSDCount = T_XSDDomain.GetInstance().GetAllModels <int>(whereXSD).Count; //待审批的销售单数量

                Expression <Func <T_SHD, bool> > whereSHD = p => p.ISSH == 0;
                var SHDCount = T_SHDDomain.GetInstance().GetAllModels <int>(whereSHD).Count; //待审批的损耗单数量

                Expression <Func <T_THD, bool> > whereTHD = p => p.ISSH == 0;
                var THHDCount = T_THDDomain.GetInstance().GetAllModels <int>(whereTHD).Count; //待审批的退货单数量

                if (SupQYCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "SupQYManage", "/T_SupQY/Index/", "供货企业", SupQYCount, "供货企业待审批"));
                }
                if (YLCPCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "YLCPManage", "/T_YLCP/Index/", "产品信息", YLCPCount, "产品待审批"));
                }
                if (CusQYCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "CusQYManage", "/T_CusQY/Index/", "购货企业", CusQYCount, "购货企业待审批"));
                }
                if (CGDCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "CGDManage", "/T_CGD/Index/", "采购管理", CGDCount, "采购单待审批"));
                }
                if (RKDCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "RKDManage", "/T_RKD/Index/", "入库管理", RKDCount, "入库单待审批"));
                }
                if (XSDCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "XSDManage", "/T_XSD/Index/", "销售管理", XSDCount, "销售单待审批"));
                }
                if (SHDCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "SHDManage", "/T_SHD/Index/", "损耗管理", SHDCount, "损耗单待审批"));
                }
                if (THHDCount > 0)
                {
                    strHtml.Append(string.Format(strTemplete, "THDManage", "/T_THD/Index/", "退货管理", THHDCount, "退货单待审批"));
                }
                #endregion
            }
            return(strHtml.ToString());
        }