Beispiel #1
0
        public FileStreamResult CreateExcelToClient()
        {
            int page = 0, rows = 0;
            string unitListCode = Request.QueryString["unitListCode"];
            string unitListName = Request.QueryString["unitListName"];
            string uniformCode = Request.QueryString["uniformCode"];
            string unitCode1 = Request.QueryString["unitCode1"];
            string unitCode2 = Request.QueryString["unitCode2"];
            string unitCode3 = Request.QueryString["unitCode3"];
            string unitCode4 = Request.QueryString["unitCode4"];
            string isActive = Request.QueryString["isActive"];
            UnitList unitlist = new UnitList();
            unitlist.UnitListCode = unitListCode;
            unitlist.UnitListName = unitListName;
            unitlist.UniformCode = uniformCode;
            unitlist.UnitCode01 = unitCode1;
            unitlist.UnitCode02 = unitCode2;
            unitlist.UnitCode03 = unitCode3;
            unitlist.UnitCode04 = unitCode4;
            unitlist.IsActive = isActive;

            ExportParam ep = new ExportParam();
            ep.DT1 = UnitListService.GetUnitList(page, rows, unitlist);
            ep.HeadTitle1 = "单位系列";
            return PrintService.Print(ep);
        }
 //
 // GET: /UnitList/Details/
 public ActionResult Details(int page, int rows, FormCollection collection)
 {
     UnitList ul = new UnitList();
     ul.UnitListCode = collection["UnitListCode"] ?? "";
     ul.UnitListName = collection["UnitListName"] ?? "";
     ul.UniformCode = collection["UniformCode"] ?? "";
     ul.UnitCode01 = collection["UnitCode01"] ?? "";
     ul.UnitName01 = collection["UnitName01"] ?? "";
     ul.UnitCode02 = collection["UnitCode02"] ?? "";
     ul.UnitName02 = collection["UnitName02"] ?? "";
     ul.UnitCode03 = collection["UnitCode03"] ?? "";
     ul.UnitName03 = collection["UnitName03"] ?? "";
     ul.UnitCode04 = collection["UnitCode04"] ?? "";
     ul.UnitName04 = collection["UnitName04"] ?? "";
     ul.IsActive = collection["IsActive"] ?? "";
     var users = UnitListService.GetDetails(page, rows, ul);
     return Json(users, "text", JsonRequestBehavior.AllowGet);
 }
        public FileStreamResult CreateExcelToClient()
        {
            int page = 0, rows = 0;
            string unitListCode = Request.QueryString["unitListCode"];
            string unitListName = Request.QueryString["unitListName"];
            string uniformCode = Request.QueryString["uniformCode"];
            string unitCode1 = Request.QueryString["unitCode1"];
            string unitCode2 = Request.QueryString["unitCode2"];
            string unitCode3 = Request.QueryString["unitCode3"];
            string unitCode4 = Request.QueryString["unitCode4"];
            string isActive = Request.QueryString["isActive"];
            UnitList unitlist = new UnitList();
            unitlist.UnitListCode = unitListCode;
            unitlist.UnitListName = unitListName;
            unitlist.UniformCode = uniformCode;
            unitlist.UnitCode01 = unitCode1;
            unitlist.UnitCode02 = unitCode2;
            unitlist.UnitCode03 = unitCode3;
            unitlist.UnitCode04 = unitCode4;
            unitlist.IsActive = isActive;

            System.Data.DataTable dt = UnitListService.GetUnitList(page, rows, unitlist);
            string headText = "单位系列";
            string headFont = "微软雅黑"; Int16 headSize = 20;
            string colHeadFont = "Arial"; Int16 colHeadSize = 10;
            string[] HeaderFooder = {
                                         "……"  //眉左
                                        ,"……"  //眉中
                                        ,"……"  //眉右
                                        ,"&D"    //脚左 日期
                                        ,"……"  //脚中
                                        ,"&P"    //脚右 页码
                                    };
            System.IO.MemoryStream ms = THOK.Common.ExportExcel.ExportDT(dt, null, headText, null, headFont, headSize
                , 0, true, colHeadFont, colHeadSize, 0, true, 0, HeaderFooder, null, 0);
            return new FileStreamResult(ms, "application/ms-excel");
        }
Beispiel #4
0
 public ActionResult Create(UnitList unitList)
 {
     bool bResult = UnitListService.Add(unitList);
     string msg = bResult ? "新增成功" : "新增失败";
     return Json(JsonMessageHelper.getJsonMessage(bResult, msg, null), "text", JsonRequestBehavior.AllowGet);
 }
Beispiel #5
0
 //
 // POST: /UnitList/Edit/
 public ActionResult Edit(UnitList unitList)
 {
     string strResult = string.Empty;
     bool bResult = UnitListService.Save(unitList,out strResult);
     string msg = bResult ? "修改成功" : "修改失败";
     return Json(JsonMessageHelper.getJsonMessage(bResult, msg, null), "text", JsonRequestBehavior.AllowGet);
 }