Exemple #1
0
        public void Save(T_WhsQYModels model)
        {
            int result = 0;

            try
            {
                if (model.Tag == "Add")
                {
                    result = T_WhsQYDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    result = T_WhsQYDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.WhsID);
                }
                //企业资质操作
                T_WhsQYDomain.GetInstance().OperQyzz(model.DataModel.WhsID, model.QYZZFiles);
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/T_WhsQY/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Exemple #2
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));
        }
Exemple #3
0
        public ActionResult Save(System.Int32 id, string tag)
        {
            T_WhsQYModels model = new T_WhsQYModels();

            model.DataModel = new T_WhsQY();
            if (id != 0)
            {
                model.DataModel   = T_WhsQYDomain.GetInstance().GetModelById(id);
                model.WhsQYZZList = T_WhsQYZZDomain.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;
            GetRoleCode(model);
            return(View("~/Views/T_WhsQY/Save.cshtml", model));
        }
Exemple #4
0
        public void Save(SysUserModels model)
        {
            int result = 0;

            try
            {
                if (model.DataModel.UserCompanyID == null)
                {
                    Expression <Func <T_WhsQY, bool> > where = PredicateBuilder.True <T_WhsQY>();
                    var list = T_WhsQYDomain.GetInstance().GetAllModels <System.Int32>(where);
                    if (list != null && list.Count > 0)
                    {
                        model.DataModel.UserCompanyID = list[0].WhsID;
                    }
                    else
                    {
                        Response.Write("{\"statusCode\":\"300\", \"message\":\"请先添加本企业信息\"}");
                    }
                }
                if (model.Tag == "Add")
                {
                    model.DataModel.UserCreateDate = DateTime.Now;
                    result = SysUserDomain.GetInstance().AddModel(model.DataModel);
                }
                else if (model.Tag == "Edit")
                {
                    model.DataModel.UserCreateDate = DateTime.Now;
                    result = SysUserDomain.GetInstance().UpdateModel(model.DataModel, model.DataModel.UserId);
                }
            }
            catch { }
            Response.ContentType = "text/json";
            if (result > 0)
            {
                Response.Write("{\"statusCode\":\"200\", \"message\":\"操作成功\",\"callbackType\":\"closeCurrentReloadTab\",\"forwardUrl\":\"/SysUser/Index\"}");
            }
            else
            {
                Response.Write("{\"statusCode\":\"300\", \"message\":\"操作失败\"}");
            }
        }
Exemple #5
0
        public ActionResult Index(T_WhsQYModels 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_WhsQY();

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

            evalModel.DataList    = T_WhsQYDomain.GetInstance().PageT_WhsQY(evalModel.DataModel, evalModel.StartTime, evalModel.EndTime, currentPage, pagesize, out pagecount, out resultCount);
            evalModel.resultCount = resultCount;
            //GetRoleCode(evalModel);
            return(View("~/Views/T_WhsQY/Index.cshtml", evalModel));
        }
Exemple #6
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\":\"操作失败\"}");
            }
        }
Exemple #7
0
        private string ExportExcelPRNew(System.Int32 id)
        {
            //获取需要打印的数据
            var ckdinfo = T_SHDDomain.GetInstance().GetModelById(id);

            List <T_SHMX> ckmxList = T_SHMXDomain.GetInstance().GetListModelById(id);
            T_WhsQY       qy       = new T_WhsQY();

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

            if (lst != null && lst.Count > 0)
            {
                qy = lst[0];
            }
            //命名导出表格的StringBuilder变量
            StringBuilder sHtml = new StringBuilder(string.Empty);

            //打印表头
            sHtml.Append("<table style='border-collapse:collapse;'>");
            sHtml.Append("<tr height=\"40\"><td colspan=\"12\" align=\"center\" style='font-size:24px;border:0px;'><b>" + qy.WhsMC + "损耗单" + "</b></td></tr>");
            sHtml.Append("<tr height=\"40\"><td align=\"left\"  colspan=\"8\" style='border:0px;'>日 期:" + DateTime.Now.ToString("yyyy-MM-dd") + "</td><td align=\"right\"  colspan=\"4\"  style='border:0px;'>单据编号:" + DateTime.Now.ToString("yyyyMMddHHmmssffff") + "</td></tr>");
            //sHtml.Append("</table>");
            //sHtml.Append("<table border=\"1\" width=\"100%\" style='border-collapse:collapse;border:1px solid black;'>");
            sHtml.Append("<tr align=\"center\" ><td style='width: 80px;'>产品名称</td><td style='width: 40px;'>规格</td><td style='width: 40px;'>型号</td><td style='width: 100px;'>生产企业</td><td style='width: 70px;'>生产日期</td><td style='width: 35px;'>单位</td><td style='width: 35px;'>数量</td><td style='width: 40px;'>单价</td>"
                         + "<td style='width: 60px;'>金额</td><td style='width: 70px;'>产品批号</td><td style='width: 80px;'>产品有效期</td><td style='width: 80px;'>经营许可证号</td><td style='width: 70px;'>注册证号</td></tr>");

            //合计
            double total    = 0.0;
            double NumCpNum = 0.0;

            for (int i = 0; i < ckmxList.Count; i++)
            {
                var ckmx = ckmxList[i];
                //产品名称
                string cpName = ckmx.T_YLCP.CPMC;
                //规格
                string cpGg = ckmx.T_YLCP.CPGG ?? "";

                var cpxh = ckmx.T_YLCP.CPXH ?? "";
                //单位
                string cpDw = ckmx.T_YLCP.CPDW ?? "";
                //数量
                double cpDj = ckmx.CPNUM ?? 0;
                //产品批号
                string scPh = ckmx.CPPH ?? "";
                //产品有效期
                string scRq = "";
                if (ckmx.CPYXQ != null)
                {
                    scRq = ckmx.CPYXQ.Value.ToString("yyyyMMdd");
                }
                var scrq = "";
                if (ckmx.CPSCRQ != null)
                {
                    scrq = ckmx.CPSCRQ.Value.ToString("yyyyMMdd");
                }
                //生产企业
                string cpScqy = "";
                if (ckmx.T_YLCP != null && ckmx.T_YLCP.T_SupQY1 != null && !string.IsNullOrEmpty(ckmx.T_YLCP.T_SupQY1.SupMC))
                {
                    cpScqy = ckmx.T_YLCP.T_SupQY1.SupMC;
                }
                //单价
                double cpPrice = Math.Round(ckmx.T_YLCP.CPPrice ?? 0.0, 2);
                //产品总价
                double rowTotal = Math.Round(cpDj * cpPrice, 2);

                total    = total + rowTotal;
                NumCpNum = NumCpNum + cpDj;
                //经营许可证号
                string xkzbh = "";
                if (ckmx.T_YLCP != null && ckmx.T_YLCP.T_SupQY1 != null && !string.IsNullOrEmpty(ckmx.T_YLCP.T_SupQY1.SupXKZBH))
                {
                    xkzbh = ckmx.T_YLCP.T_SupQY1.SupXKZBH;
                }
                //注册证号
                string cpzczh = ckmx.T_YLCP.CPZCZ;
                sHtml.Append("<tr align=\"center\"><td>" + cpName
                             + "</td><td>" + cpGg + "</td><td>" + cpxh + "</td><td>" + cpScqy
                             + "</td><td>" + scrq
                             + "</td><td>" + cpDw + "</td><td>" + cpDj.ToString()
                             + "</td><td>" + cpPrice.ToString("0.00") + "</td><td>" + rowTotal.ToString("0.00") + "</td><td>" + scPh + "</td><td>" + scRq
                             + "</td><td>" + xkzbh
                             + "</td><td>" + cpzczh
                             + "</td></tr>");
            }
            //打印表尾
            sHtml.Append("<tr id='trtotal' height=\"40\" align=\"center\"><td colspan=\"9\">合计金额:(大写)" + MoneySmallToBig(total.ToString()) + "</td><td colspan=\"4\">(小写)" + total.ToString("0.00") + "</td></tr>");
            //sHtml.Append("</table>");
            //sHtml.Append("<table  border=\"0\" width=\"100%\">");
            sHtml.Append("<tr height=\"40\" align=\"center\"><td colspan=\"7\" align=\"left\" style='border:0px;'>申请人:&nbsp;" + ckdinfo.SQR + "</td><td align=\"left\" colspan='5' style='border:0px;'>复核员:&nbsp;" + ckdinfo.FHY + "</td></tr>");
            sHtml.Append("</table>");
            return(sHtml.ToString());
        }
Exemple #8
0
        public string ExportExcelPR2(System.Int32 id)
        {
            //获取需要打印的数据
            T_CKD ckdinfo = new T_CKD();

            List <T_CKD> list = T_CKDDomain.GetInstance().GetListModelById(id);

            if (list.Count > 0)
            {
                ckdinfo = list[0];
            }

            int xsqyid = 0;

            if (ckdinfo.T_XSD != null && ckdinfo.T_XSD.KHID.HasValue)
            {
                xsqyid = ckdinfo.T_XSD.KHID.Value;
            }

            T_CusQY cusqy = T_CusQYDomain.GetInstance().GetModelById(xsqyid);
            //购货企业名称
            string xsqyName = (cusqy != null && !string.IsNullOrEmpty(cusqy.CusMC)) ? cusqy.CusMC : "";
            string xsqyKFDZ = (cusqy != null) ? cusqy.CusKFDZ : ""; //库房地址

            List <T_CKMX> ckmxList = T_CKMXDomain.GetInstance().GetListModelById(id);
            T_WhsQY       qy       = new T_WhsQY();

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

            if (lst != null && lst.Count > 0)
            {
                qy = lst[0];
            }
            //命名导出表格的StringBuilder变量
            StringBuilder sHtml = new StringBuilder(string.Empty);

            //打印表头
            sHtml.Append("<table style='border-collapse:collapse;' rull='all'>");
            sHtml.Append("<tr height=\"40\"><td colspan=\"12\" align=\"center\" style='font-size:24px;border:0px;'>" + qy.WhsMC + "销售复核出库单" + "</td></tr>");
            sHtml.Append("<tr height=\"40\"><td colspan=\"5\" align=\"left\" style='border:0px;'>购货单位:" + xsqyName + "</td><td align=\"left\"  colspan=\"3\" style='border:0px;'>日 期:" + DateTime.Now.ToString("yyyy-MM-dd") + "</td><td align=\"center\"  colspan=\"4\" style='border:0px;'>单据编号:" + DateTime.Now.ToString("yyyyMMddHHmmss") + "</td></tr>");
            sHtml.Append("<tr><td colspan=\"12\" height=\"30\" style='border:0px;'>地址:" + xsqyKFDZ + "</td></tr>");
            sHtml.Append("<tr align=\"center\" ><td style='width: 100px;' >产品名称</td><td style='width: 40px;' >规格</td><td style='width: 40px;' >型号</td><td style='width:128px;' >生产企业</td><td style='width: 35px;' >单位</td><td style='width: 35px;' >数量</td><td style='width: 70px;' >产品批号</td><td style='width: 65px;'>生产日期\r\n--------\r\n失效日期</td><td style='width: 65px;' >生产/经营\r\n许可证号</td><td style='width: 60px;' >注册证号</td><td style='width: 35px;' >储运条件</td><td style='width: 32px;border-right: thin solid black;' >备注</td></tr>");

            //合计
            double total    = 0.0;
            double NumCpNum = 0.0;

            for (int i = 0; i < ckmxList.Count; i++)
            {
                T_CKMX ckmx = ckmxList[i];
                //产品名称
                string cpName = ckmx.T_YLCP.CPMC;
                //规格
                string cpGg = ckmx.T_YLCP.CPGG ?? "";
                var    cpxh = ckmx.T_YLCP.CPXH ?? "";
                //单位
                string cpDw = ckmx.T_YLCP.CPDW ?? "";
                //数量
                double cpDj = ckmx.CPNUM ?? 0;
                //产品批号
                string scPh = ckmx.CPPH ?? "";
                //产品有效期
                string scRq = "";
                if (ckmx.CPYXQ != null)
                {
                    scRq = ckmx.CPYXQ.Value.ToString("yyyyMMdd");
                }
                var scrq = "";
                if (ckmx.CPSCRQ != null)
                {
                    scrq = ckmx.CPSCRQ.Value.ToString("yyyyMMdd");
                }
                //生产企业
                string cpScqy = "";
                if (ckmx.T_YLCP != null && ckmx.T_YLCP.T_SupQY1 != null && !string.IsNullOrEmpty(ckmx.T_YLCP.T_SupQY1.SupMC))
                {
                    cpScqy = ckmx.T_YLCP.T_SupQY1.SupMC;
                }
                //单价
                double cpPrice = Math.Round(ckmx.CPPRICE ?? 0.0, 2);
                //产品总价
                double rowTotal = Math.Round(cpDj * cpPrice, 2);

                total    = total + rowTotal;
                NumCpNum = NumCpNum + cpDj;
                //经营许可证号
                string xkzbh = "";
                if (ckmx.T_YLCP != null && ckmx.T_YLCP.T_SupQY1 != null && !string.IsNullOrEmpty(ckmx.T_YLCP.T_SupQY1.SupXKZBH))
                {
                    xkzbh = ckmx.T_YLCP.T_SupQY1.SupXKZBH;
                }
                //注册证号
                string cpzczh = ckmx.T_YLCP.CPZCZ;
                var    cytj   = ckmx.CYTJ;
                sHtml.Append("<tr align=\"center\"><td >" + cpName
                             + "</td><td style='vnd.ms-excel.numberformat:@' >" + cpGg + "</td><td style='vnd.ms-excel.numberformat:@' >" + cpxh + "</td><td >" + cpScqy
                             + "</td><td >" + cpDw + "</td><td style='vnd.ms-excel.numberformat:@'  >" + cpDj.ToString("") + "</td><td  style='vnd.ms-excel.numberformat:@' >" + scPh
                             + "</td><td style='vnd.ms-excel.numberformat:@'>" + scrq + "\r\n" + "--------" + "\r\n" + scRq + " </td>"
                             + "<td style='vnd.ms-excel.numberformat:@' >" + xkzbh
                             + "</td><td style='vnd.ms-excel.numberformat:@' >" + cpzczh
                             + "</td><td >" + cytj
                             + "</td><td style='border-right: thin solid black;' ></td></tr>");
            }
            //打印表尾
            sHtml.Append("<tr id='trtotal' height=\"40\" align=\"center\"><td colspan=\"7\" style='border-bottom: thin solid black;font-size:16px;'>合计金额:(大写)" + RmbHelper.CmycurD(total.ToString()) + "</td><td colspan=\"5\" style='border-bottom: thin solid black;border-right: thin solid black;font-size:16px;'>(小写)" + total.ToString("0.00") + "</td></tr>");
            var xsry = ckdinfo.T_XSD == null ? "" : ckdinfo.T_XSD.XSRY;

            sHtml.Append("<tr height=\"40\" align=\"center\"><td colspan=\"3\" align=\"left\" style='border:0px;'>销售员:&nbsp;" + xsry + "</td><td align=\"center\" colspan=\"3\" style='border:0px;'>复核员:&nbsp;" + ckdinfo.FHR + "</td ><td align =\"center\" colspan=\"3\" style='border:0px;'>出库员:&nbsp;" + ckdinfo.CKCHR + "</td ><td align =\"center\" colspan=\"3\" style='border:0px;'>收货人:&nbsp;</td></tr>");
            sHtml.Append("<tr><td colspan=\"12\" style='border:0px;'>公司地址:" + qy.WhsZCDZ + "</td></tr>");
            sHtml.Append("</table>");
            return(sHtml.ToString());
        }