Beispiel #1
0
        public ActionResult Details(System.Int32 id)
        {
            T_RKDModels model = new T_RKDModels();

            model.DataModel = T_RKDDomain.GetInstance().GetModelById(id);
            model.RKMXList  = T_RKMXDomain.GetInstance().GetT_RKMXByRkid(id);
            CurUser         = Session["UserModel"] as SysUser;
            T_Person person = new T_Person();

            person.PsQYID = (int)CurUser.UserCompanyID;
            List <T_Person> personList = T_PersonDomain.GetInstance().GetAllT_Person(person);

            ////申请人
            //if (!string.IsNullOrEmpty(model.DataModel.SQPE))
            //{
            //    var sqr = personList.Where(p => p.PsID.ToString() == model.DataModel.SQPE).FirstOrDefault();
            //    model.SQRMC = (sqr != null && !string.IsNullOrEmpty(sqr.PsMZ)) ? sqr.PsMZ : "";
            //}
            ////仓库管理人
            //if (!string.IsNullOrEmpty(model.DataModel.CKGLRY))
            //{
            //    var ckr = personList.Where(p => p.PsID.ToString() == model.DataModel.CKGLRY).FirstOrDefault();
            //    model.CKRMC = (ckr != null && !string.IsNullOrEmpty(ckr.PsMZ)) ? ckr.PsMZ : "";
            //}
            ViewData["ParaStr"] = ExportExcelPR(id);
            return(View("~/Views/T_RKD/Details.cshtml", model));
        }
Beispiel #2
0
        public void Save(T_PersonModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    result = T_PersonDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = T_PersonDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.PsID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_Person/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Beispiel #3
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            CurUser = Session["UserModel"] as SysUser;
            T_SHDModels model = new T_SHDModels();

            //加载产品列表
            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_Person person = new T_Person();

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

            model.DataModel = new T_SHD();
            if (id != 0)
            {
                model.DataModel = T_SHDDomain.GetInstance().GetModelById(id);
                model.SHMXList  = T_SHDDomain.GetInstance().GetT_SHMXByshid(id);
            }
            else
            {
                model.DataModel.SHDH   = T_SHDDomain.GetInstance().GetSHOrderNum(CurUser);
                model.DataModel.SHCJR  = CurUser.UserAccount;
                model.DataModel.SHCJRQ = DateTime.Now;
            }
            model.Tag      = tag;
            model.RoleCode = GetRoleCode();
            return(View("~/Views/T_SHD/Save.cshtml", model));
        }
Beispiel #4
0
        public ActionResult Index(T_CKModels 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_CK();
            if (Request["strCKName"] != null)
            {
                string str = Request["strCKName"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.CKID = int.Parse(str);
                }
                ViewData["strCKName"] = str;
            }
            var strCKPerson = "请选择";

            if (Request["strCKPerson"] != null)
            {
                strCKPerson = Request["strCKPerson"].ToString();
                if (!String.IsNullOrEmpty(strCKPerson))
                {
                    evalModel.DataModel.CKGLY = strCKPerson;
                }
            }
            SysUser  UserModel = Session["UserModel"] as SysUser;
            T_Person person    = new T_Person();

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

            var lstck = GetAllCK();

            ViewBag.CKList = new SelectList(lstck, "CKID", "CKMC");

            evalModel.DataList    = T_CKDomain.GetInstance().PageT_CK(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_CK/Index.cshtml", evalModel));
        }
Beispiel #5
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));
        }
Beispiel #6
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            //加载购买商商企业列表
            T_CusQYModels cusQymode = new T_CusQYModels();

            cusQymode.DataModel = cusQymode.DataModel ?? new T_CusQY();

            cusQymode.DataList = T_CusQYDomain.GetInstance().GetAllT_CusQY(cusQymode.DataModel).Where(p => p.CusStatus == Convert.ToInt32("1")).ToList();

            ViewData["CusQY"] = new SelectList(cusQymode.DataList, "CusID", "CusMC");

            //加载销售人员列表
            T_PersonModels perQymode = new T_PersonModels();

            perQymode.DataModel = perQymode.DataModel ?? new T_Person();

            perQymode.DataList = T_PersonDomain.GetInstance().GetAllT_Person(perQymode.DataModel);

            ViewData["Person"] = new SelectList(perQymode.DataList, "PsMZ", "PsMZ");

            //加载销售合同列表
            //T_XSHTModels xshtQymode = new T_XSHTModels();

            //xshtQymode.DataModel = xshtQymode.DataModel ?? new T_XSHT();

            //xshtQymode.DataList = T_XSHTDomain.GetInstance().GetAllT_XSHT(xshtQymode.DataModel);

            //ViewData["XSHT"] = new SelectList(xshtQymode.DataList, "HTID", "HTMC");

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

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

            ylcpmode.DataList = T_YLCPDomain.GetInstance().GetAllT_YLCP(ylcpmode.DataModel).Where(p => p.CPStatus == 1).ToList();

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

            T_XSDModels model = new T_XSDModels();

            model.DataModel = new T_XSD();
            CurUser         = Session["UserModel"] as SysUser;
            if (id != 0)
            {
                model.DataModel = T_XSDDomain.GetInstance().GetModelById(id);
                model.XSMXList  = T_XSMXDomain.GetInstance().GetT_XSMXByXsid(id);
            }
            else
            {
                model.DataModel.XSDH   = T_XSDDomain.GetInstance().GetXsOrderNum(CurUser);
                model.DataModel.XSCJR  = CurUser.UserAccount;
                model.DataModel.XSCJRQ = DateTime.Now;
            }
            model.RoleCode = GetRoleCode();
            model.Tag      = tag;
            return(View("~/Views/T_XSD/Save.cshtml", model));
        }
Beispiel #7
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            CurUser = Session["UserModel"] as SysUser;
            T_CKDModels model = new T_CKDModels();
            //加载销售单列表
            T_XSDModels xsdmode = new T_XSDModels();

            xsdmode.DataModel = xsdmode.DataModel ?? new T_XSD();
            xsdmode.DataList  = T_XSDDomain.GetInstance().GetAllT_XSD(xsdmode.DataModel).Where(p => p.XSFLAG == Convert.ToInt32("1")).ToList();
            ViewData["XSD"]   = new SelectList(xsdmode.DataList, "XSID", "XSDH");

            //加载仓库列表
            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_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_Person person = new T_Person();

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

            model.DataModel = new T_CKD();
            if (id != 0)
            {
                model.DataModel = T_CKDDomain.GetInstance().GetModelById(id);
                model.CKMXList  = T_CKMXDomain.GetInstance().GetT_CKMXByCkid(id);
                if (model.DataModel.XSID != null && model.DataModel.XSID != 0)
                {
                    var temp = T_XSDDomain.GetInstance().GetModelById(model.DataModel.XSID);
                    if (temp != null)
                    {
                        model.XSDH = temp.XSDH;
                    }
                }
            }
            else
            {
                model.DataModel.CKDH   = T_CKDDomain.GetInstance().GetCkOrderNum(CurUser);
                model.DataModel.CKCJR  = CurUser.UserAccount;
                model.DataModel.CKCJRQ = DateTime.Now;
            }
            model.Tag      = tag;
            model.RoleCode = GetRoleCode();
            return(View("~/Views/T_CKD/Save.cshtml", model));
        }
Beispiel #8
0
        public ActionResult Index(T_THDModels 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_THD();

            if (Request["strTHMC"] != null)
            {
                string str = Request["strTHMC"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.THMC = str;
                }
            }

            if (Request["strTHSQPerson"] != null)
            {
                string str = Request["strTHSQPerson"].ToString();
                if (!String.IsNullOrEmpty(str))
                {
                    evalModel.DataModel.SQR = str;
                }
                ViewData["strTHSQPerson"] = str;
            }
            //获取本企业下的人员列表
            SysUser  UserModel = Session["UserModel"] as SysUser;
            T_Person person    = new T_Person();

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

            evalModel.DataList    = T_THDDomain.GetInstance().PageT_THD(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount).ToList();
            evalModel.resultCount = resultCount;
            return(View("~/Views/T_THD/Index.cshtml", evalModel));
        }
Beispiel #9
0
        public ActionResult Index(T_PersonModels evalModel)
        {
            string strName = "";
            string strCode = "";

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

            if (Request["strName"] != null)
            {
                strName = Request["strName"].ToString();
                if (!String.IsNullOrEmpty(strName))
                {
                    evalModel.DataModel.PsMZ = strName;
                }
                ViewData["strName"] = strName;
            }

            if (Request["strCode"] != null)
            {
                strCode = Request["strCode"].ToString();
                if (!String.IsNullOrEmpty(strCode))
                {
                    evalModel.DataModel.PsSFZ = strCode;
                }
                ViewData["strCode"] = strCode;
            }

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


            return(View("~/Views/T_Person/Index.cshtml", evalModel));
        }
Beispiel #10
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));
        }
Beispiel #11
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_PersonModels model = new T_PersonModels();

            //加载批发商企业列表
            T_WhsQYModels whsQymode = new T_WhsQYModels();

            whsQymode.DataModel = whsQymode.DataModel ?? new T_WhsQY();

            whsQymode.DataList = T_WhsQYDomain.GetInstance().GetAllT_WhsQY(whsQymode.DataModel);

            ViewData["WHSQY"] = new SelectList(whsQymode.DataList, "WhsID", "WhsMC", "请选择");

            model.DataModel = new T_Person();
            if (id != 0)
            {
                model.DataModel = T_PersonDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;

            //加载性别类型
            List <SelectListItem> list = new List <SelectListItem>();

            list.Add(new SelectListItem {
                Text = "男", Value = "男"
            });
            list.Add(new SelectListItem {
                Text = "女", Value = "女"
            });

            ViewData["XB"] = new SelectList(list, "Value", "Text", "请选择");

            //加载学历类型
            List <SelectListItem> xlList = new List <SelectListItem>();

            xlList.Add(new SelectListItem {
                Text = "大专", Value = "大专"
            });
            xlList.Add(new SelectListItem {
                Text = "本科", Value = "本科"
            });
            xlList.Add(new SelectListItem {
                Text = "硕士", Value = "硕士"
            });
            xlList.Add(new SelectListItem {
                Text = "博士", Value = "博士"
            });

            ViewData["XL"] = new SelectList(xlList, "Value", "Text", "请选择");

            return(View("~/Views/T_Person/Save.cshtml", model));
        }
Beispiel #12
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));
        }
Beispiel #13
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_CKModels model = new T_CKModels();

            model.DataModel = new T_CK();
            if (id != 0)
            {
                model.DataModel = T_CKDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            T_Person person    = new T_Person();
            SysUser  UserModel = Session["UserModel"] as SysUser;

            person.PsQYID   = (int)UserModel.UserCompanyID;
            ViewBag.Persons = new SelectList(T_PersonDomain.GetInstance().GetAllT_Person(person), "PsMZ", "PsMZ");
            return(View("~/Views/T_CK/Save.cshtml", model));
        }
Beispiel #14
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));
        }
Beispiel #15
0
        public void Delete(System.Int32 id)
        {
            Expression <Func <T_Person, bool> > where = p => (p.PsQYID == id);
            var list = T_PersonDomain.GetInstance().GetAllModels <int>(where);

            if (list != null && list.Count > 0)
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"该企业下已有人员,不能删除!\"}");
                return;
            }
            int result = T_WhsQYDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/T_WhsQY/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Beispiel #16
0
        public ActionResult XSDSPIndex(System.Int32 id, string tag)
        {
            //加载购买商商企业列表
            T_CusQYModels cusQymode = new T_CusQYModels();

            cusQymode.DataModel = cusQymode.DataModel ?? new T_CusQY();

            cusQymode.DataList = T_CusQYDomain.GetInstance().GetAllT_CusQY(cusQymode.DataModel).Where(p => p.CusStatus == Convert.ToInt32("1")).ToList();

            ViewData["CusQY"] = new SelectList(cusQymode.DataList, "CusID", "CusMC");

            //加载销售人员列表
            T_PersonModels perQymode = new T_PersonModels();

            perQymode.DataModel = perQymode.DataModel ?? new T_Person();

            perQymode.DataList = T_PersonDomain.GetInstance().GetAllT_Person(perQymode.DataModel);

            ViewData["Person"] = new SelectList(perQymode.DataList, "PsID", "PsMZ");

            T_XSDModels model = new T_XSDModels();

            model.DataModel = new T_XSD();
            T_XSMX xsmodel = new T_XSMX();

            if (id != 0)
            {
                model.DataModel = T_XSDDomain.GetInstance().GetModelById(id);
                model.XSMXList  = T_XSMXDomain.GetInstance().GetAllT_XSMX(xsmodel);
                if (model.XSMXList.Count > 0)
                {
                    model.XSMXList = model.XSMXList.Where(p => p.XSID == id).ToList();
                }
            }
            model.Tag = tag;
            return(View("~/Views/T_XSD/XSDSPIndex.cshtml", model));
        }
Beispiel #17
0
        public void Delete(System.Int32 id)
        {
            T_PersonModels model = new T_PersonModels();

            model.DataModel = new T_Person();
            if (id != 0)
            {
                model.DataModel = T_PersonDomain.GetInstance().GetModelById(id);
            }
            if (model.DataModel.PsSFZSM != null)
            {
                string filePath = Path.Combine(Server.MapPath("~/UploadFiles/"), "本企业人员身份证扫描件", model.DataModel.PsSFZSM);
                if (System.IO.File.Exists(filePath))
                {
                    System.IO.File.Delete(filePath);
                }
            }
            if (model.DataModel.PsZZFJ != null)
            {
                string filePath1 = Path.Combine(Server.MapPath("~/UploadFiles/"), "本企业人员资质", model.DataModel.PsZZFJ);
                if (System.IO.File.Exists(filePath1))
                {
                    System.IO.File.Delete(filePath1);
                }
            }
            int result = T_PersonDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/T_Person/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Beispiel #18
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));
        }