Esempio n. 1
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));
        }
Esempio n. 2
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));
        }
Esempio n. 3
0
        public ActionResult CGMXTable(System.Int32 id, string cgdh, int canEdit, int isSH)
        {
            T_CGDModels model = new T_CGDModels();

            model.DataModel      = new T_CGD();
            model.DataModel.ISSH = isSH;
            if (id != 0)
            {
                model.CGMXList = T_CGMXDomain.GetInstance().GetT_CGMXByCgid(id);
            }
            else
            {
                model.CGMXList = T_CGMXDomain.GetInstance().GetT_YSMXByCgdh(cgdh);
            }
            ViewBag.canEdit = canEdit;
            model.RoleCode  = GetRoleCode();
            return(View("~/Views/T_CGMX/CGMXTable.cshtml", model));
        }
Esempio n. 4
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));
        }
Esempio n. 5
0
        public ActionResult CGDSPIndex(System.Int32 id, string tag)
        {
            T_CGDModels model = new T_CGDModels();

            model.DataModel = new T_CGD();
            T_CGMX cgmodel = new T_CGMX();

            if (id != 0)
            {
                model.DataModel = T_CGDDomain.GetInstance().GetModelById(id);
                model.CGMXList  = T_CGMXDomain.GetInstance().GetAllT_CGMX(cgmodel);
                if (model.CGMXList.Count > 0)
                {
                    model.CGMXList = model.CGMXList.Where(p => p.CGID == id).ToList();
                }
            }
            model.Tag = tag;
            return(View("~/Views/T_CGD/CGDSPIndex.cshtml", model));
        }
Esempio n. 6
0
        public void through(T_CGDModels model, int id)
        {
            int result = 0;

            try
            {
                Int32 cgid = model.DataModel.CGID;
                result = T_CGDDomain.GetInstance().Sh(cgid, id);
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_CGD/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Esempio n. 7
0
        public void Save(T_CGDModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    model.DataModel.ISHG     = 0;
                    model.DataModel.ISCG     = 0;
                    model.DataModel.ISSH     = 0;
                    model.DataModel.IsFinish = 0;
                    var temp = T_CGDDomain.GetInstance().GetAllModels <string>(p => p.CGDH == model.DataModel.CGDH).FirstOrDefault();
                    if (temp != null && temp.CGID != 0)
                    {
                        var CurUser1 = Session["UserModel"] as SysUser;
                        model.DataModel.CGDH = T_CGDDomain.GetInstance().GetCgOrderNum("CP", CurUser1);
                    }
                    result = T_CGDDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    model.DataModel.ISSH = 0;
                    result = T_CGDDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.CGID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_CGD/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Esempio n. 8
0
        public ActionResult Index(T_CGDModels evalModel)
        {
            SysUser UserModel = Session["UserModel"] as SysUser;

            try
            {
                ViewData["shUserId"]  = UserModel.UserId;
                evalModel.currentPage = int.Parse(Request["pageNum"].ToString());
            }
            catch { }

            string strCGPerson = "请选择";


            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_CGD();

            if (Request["strCGPerson"] != null)
            {
                strCGPerson = Request["strCGPerson"].ToString();
                if (!String.IsNullOrEmpty(strCGPerson))
                {
                    evalModel.DataModel.CGPERSON = strCGPerson;
                }
            }
            var strCGDMC = "";

            if (Request["strCGDMC"] != null)
            {
                strCGDMC = Request["strCGDMC"].ToString();
                if (!String.IsNullOrEmpty(strCGDMC))
                {
                    evalModel.DataModel.CGDMC = strCGDMC;
                }
            }
            var cpId = 0;

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

            if (Request["strCGSupQY"] != null)
            {
                string str = Request["strCGSupQY"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    supId = Convert.ToInt32(str);
                }
                ViewData["strCGSupQY"] = 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["strCGPerson"] = strCGPerson;

            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_CGDDomain.GetInstance().PageT_CGD(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, cpId, supId, cusId, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_CGD/Index.cshtml", evalModel));
        }