コード例 #1
0
ファイル: T_CKController.cs プロジェクト: gzl118/YLQX
        public JsonResult GetCkByCkid(string ckid)
        {
            T_CK   ck    = T_CKDomain.GetInstance().GetModelById(int.Parse(ckid));
            string ckgly = (ck != null && ck.CKGLY != null) ? ck.CKGLY : "";

            return(Json(JsonConvert.SerializeObject(new { CKGLY = ckgly })));
        }
コード例 #2
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            //加载购买商商企业列表
            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_KCModels model = new T_KCModels();

            model.DataModel = new T_KC();
            if (id != 0)
            {
                model.DataModel = T_KCDomain.GetInstance().GetModelById(id);
            }
            model.Tag = tag;
            return(View("~/Views/T_KC/Save.cshtml", model));
        }
コード例 #3
0
ファイル: T_CKController.cs プロジェクト: gzl118/YLQX
        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));
        }
コード例 #4
0
ファイル: T_THDController.cs プロジェクト: gzl118/YLQX
        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));
        }
コード例 #5
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));
        }
コード例 #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));
        }
コード例 #7
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));
        }
コード例 #8
0
ファイル: T_CKController.cs プロジェクト: gzl118/YLQX
        public JsonResult GetCK(string ckid)
        {
            T_CK ck = T_CKDomain.GetInstance().GetModelById(Convert.ToInt32(ckid));

            if (ck != null)
            {
                string resultStr = JsonConvert.SerializeObject(new { CKGLY = ck.CKGLY });
                return(Json(resultStr));
            }
            else
            {
                return(Json(""));
            }
        }
コード例 #9
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));
        }
コード例 #10
0
ファイル: T_CKController.cs プロジェクト: gzl118/YLQX
        //[HttpPost]
        public List <T_CK> GetAllCK()
        {
            var lstResult = new List <T_CK>();

            try
            {
                Expression <Func <T_CK, bool> > where = PredicateBuilder.True <T_CK>();
                where     = where.And(p => p.FLAG == "是");
                lstResult = T_CKDomain.GetInstance().GetAllModels <int>(where);
            }
            catch (Exception ex)
            {
            }
            return(lstResult);
        }
コード例 #11
0
ファイル: T_CKController.cs プロジェクト: gzl118/YLQX
        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));
        }
コード例 #12
0
ファイル: T_CKController.cs プロジェクト: gzl118/YLQX
        public void Save(T_CKModels model)
        {
            int result = 0;

            try
            {
                var m = T_CKDomain.GetInstance().GetAllModels <int>(p => p.CKMC == model.DataModel.CKMC);
                if (model.Tag == "Add")
                {
                    if (m != null && m.Count > 0)
                    {
                        Response.Write("{\"statusCode\":\"300\", \"message\":\"该仓库名称已经存在\"}");
                        return;
                    }
                    result = T_CKDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    if (m != null && m.Count > 0)
                    {
                        var curm = m.Find(p => p.CKID != model.DataModel.CKID);
                        if (curm != null)
                        {
                            Response.Write("{\"statusCode\":\"300\", \"message\":\"该仓库名称已经存在\"}");
                            return;
                        }
                    }
                    result = T_CKDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.CKID);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_CK/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
コード例 #13
0
ファイル: T_CKController.cs プロジェクト: gzl118/YLQX
        public void Delete(System.Int32 id)
        {
            Expression <Func <T_RKMX, bool> > where = p => (p.CKID == id);
            var lst = T_RKMXDomain.GetInstance().GetAllModels <int>(where);

            if (lst != null && lst.Count > 0)
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"该仓库已有入库数据,不能删除!\"}");
                return;
            }
            Expression <Func <T_CKMX, bool> > whereCKMX = p => (p.CKID == id);
            var lstCKMX = T_CKMXDomain.GetInstance().GetAllModels <int>(whereCKMX);

            if (lstCKMX != null && lstCKMX.Count > 0)
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"该仓库已有出库数据,不能删除!\"}");
                return;
            }

            Expression <Func <T_KC, bool> > whereKC = p => (p.CKID == id);
            var lstKC = T_KCDomain.GetInstance().GetAllModels <int>(whereKC);

            if (lstKC != null && lstKC.Count > 0)
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"该仓库已有库存数据,不能删除!\"}");
                return;
            }

            int result = T_CKDomain.GetInstance().DeleteModelById(id);

            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"forward\",\"forwardUrl\":\"/T_CK/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
コード例 #14
0
        public JsonResult GetKCInfo(int ckid, int cpid, string cpph)
        {
            var mlist = T_KCDomain.GetInstance().GetAllModels <int>(p => p.CKID == ckid && p.CPID == cpid && p.CPPH == cpph);

            if (mlist != null && mlist.Count > 0)
            {
                var mkc = mlist.First();
                if (mkc != null)
                {
                    string resultStr = JsonConvert.SerializeObject(new { CKGLY = mkc.T_CK.CKGLY, KCNUM = mkc.CPNUM });
                    return(Json(resultStr));
                }
            }
            T_CK ck = T_CKDomain.GetInstance().GetModelById(ckid);

            if (ck != null)
            {
                string resultStr = JsonConvert.SerializeObject(new { CKGLY = ck.CKGLY, KCNUM = 0 });
                return(Json(resultStr));
            }
            return(Json(""));
        }
コード例 #15
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));
        }