コード例 #1
0
ファイル: T_RKDController.cs プロジェクト: gzl118/YLQX
        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));
        }
コード例 #2
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_RKMXModels model = new T_RKMXModels();

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

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

            //加载仓库列表
            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_RKDModels rkdQymode = new T_RKDModels();

            rkdQymode.DataModel = rkdQymode.DataModel ?? new T_RKD();
            T_RKD rkd = T_RKDDomain.GetInstance().GetModelById(did);

            rkdQymode.DataList = new List <T_RKD>();
            rkdQymode.DataList.Add(rkd);
            ViewData["RKD"] = new SelectList(rkdQymode.DataList, "RKID", "RKMC");



            //if (id != 0)
            //{
            //    model.DataModel = T_RKMXDomain.GetInstance().GetModelById(id);
            //}
            model.Tag = tag;
            return(View("~/Views/T_RKMX/Save.cshtml", model));
        }
コード例 #3
0
ファイル: T_RKDController.cs プロジェクト: gzl118/YLQX
        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));
        }
コード例 #4
0
        public ActionResult RKMXTable(System.Int32 id, string rkdh, int canEdit)
        {
            T_RKDModels model = new T_RKDModels();

            if (id != 0)
            {
                model.RKMXList = T_RKMXDomain.GetInstance().GetT_RKMXByRkid(id);
            }
            else
            {
                model.RKMXList = T_RKMXDomain.GetInstance().GetT_RKMXByRkdh(rkdh);
            }
            ViewData["ISSH"] = canEdit;
            return(View("~/Views/T_RKMX/RKMXTable.cshtml", model));
        }
コード例 #5
0
ファイル: T_RKDController.cs プロジェクト: gzl118/YLQX
        public void Save(T_RKDModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    model.DataModel.ISSH = 0;
                    model.DataModel.RKMC = model.DataModel.RKMC + DateTime.Now.ToLongDateString();

                    var temp = T_RKDDomain.GetInstance().GetAllModels <string>(p => p.RKDH == model.DataModel.RKDH).FirstOrDefault();
                    if (temp != null && temp.RKID != 0)
                    {
                        var CurUser1 = Session["UserModel"] as SysUser;
                        model.DataModel.RKDH = T_RKDDomain.GetInstance().GetRkOrderNum(CurUser1);
                    }

                    result = T_RKDDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    model.DataModel.ISSH = 0;
                    result = T_RKDDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.RKID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_RKD/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
コード例 #6
0
ファイル: T_RKDController.cs プロジェクト: gzl118/YLQX
        public void through(T_RKDModels model, int id)
        {
            int result = 0;

            try
            {
                Int32 cgid = model.DataModel.RKID;
                result = T_RKDDomain.GetInstance().Sh(cgid, id);
                if (id == 1 && model.DataModel.IsFinish == 1)  //IsFinish=1表示验收单已经完结
                {
                    T_YSDDomain.GetInstance().UpdateFinish(model.DataModel.YSDH);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_RKD/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
コード例 #7
0
ファイル: T_RKDController.cs プロジェクト: gzl118/YLQX
        public ActionResult Index(T_RKDModels 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_RKD();

            var cpId = 0;

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

            string strYSPerson = "请选择";

            if (Request["strYSPerson"] != null)
            {
                strYSPerson = Request["strYSPerson"].ToString();
                if (!String.IsNullOrEmpty(strYSPerson))
                {
                    evalModel.DataModel.CKGLRY = strYSPerson;
                }
            }
            ViewData["strYSPerson"] = strYSPerson;
            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;
            }

            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");

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