Beispiel #1
0
 public ActionResult Get(int pageSize, int pageNum)
 {
     return(Json(workCodeTypeOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         criteria.AddOrder(Order.Desc("ModDate"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #2
0
        public ActionResult DownLoadDept()
        {
            string fileName = Server.MapPath("/") + @"Files\Temp\" + "1.xlsx";

            IList <ExcelField> fields = new List <ExcelField>();

            ExcelField ef = null;

            ef = new ExcelField("Code", "代码");
            fields.Add(ef);
            ef = new ExcelField("Name", "名字");
            fields.Add(ef);
            ef = new ExcelField("TestExcel", "测试Excel");
            fields.Add(ef);

            TbBaseOper <Department> departmentOper = new TbBaseOper <Department>(HibernateOper, typeof(Department));
            IList <Department>      list           = departmentOper.Get();

            //ExportExcel ee = new ExportExcel(fileName, "abc", fields);
            ExportExcel ee = new ExportExcel(fileName, typeof(Department));

            ee.Save(list);

            //返回文件
            return(File(fileName, "xlsx", "1.xlsx"));
        }
 public ActionResult Get(int pageSize, int pageNum, string checkStockID, string goodsID, string sysQty, string qty, string profitLoss)
 {
     return(Json(checkStockDetailOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(checkStockID))
         {
             ICriterion criterion = Restrictions.Eq("CheckStockID", PojoUtil.InitPojo <CheckStock>(checkStockID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(goodsID))
         {
             ICriterion criterion = Restrictions.Eq("GoodsID", PojoUtil.InitPojo <GoodsInfo>(goodsID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(sysQty))
         {
             ICriterion criterion = Restrictions.Like("SysQty", sysQty, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(qty))
         {
             ICriterion criterion = Restrictions.Like("Qty", qty, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(profitLoss))
         {
             ICriterion criterion = Restrictions.Like("ProfitLoss", profitLoss, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("CheckStockID"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #4
0
        public ActionResult Get(int pageSize, int pageNum, string cstmrName, string contact, string phoneNum)
        {
            return(Json(workOper.Get(
                            delegate(object sender, ICriteria criteria)
            {
                if (!string.IsNullOrEmpty(cstmrName))
                {
                    ICriterion criterion = Restrictions.Like("Cstmr.Name", cstmrName, MatchMode.Anywhere);
                    criteria.Add(criterion);
                }
                if (!string.IsNullOrEmpty(contact))
                {
                    ICriterion criterion = Restrictions.Like("Contact", contact, MatchMode.Anywhere);
                    criteria.Add(criterion);
                }
                if (!string.IsNullOrEmpty(phoneNum))
                {
                    ICriterion criterion = Restrictions.Like("PhoneNum", phoneNum, MatchMode.Anywhere);
                    criteria.Add(criterion);
                }

                criteria.AddOrder(Order.Desc("ModDate"));
            }
                            , pageSize, pageNum)));
        }
 public ActionResult Get(int pageSize, int pageNum, string retOrderID, string goodsID, string price, string qty)
 {
     return(Json(retOrderDetailOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(retOrderID))
         {
             ICriterion criterion = Restrictions.Eq("RetOrderID", PojoUtil.InitPojo <RetOrder>(retOrderID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(goodsID))
         {
             ICriterion criterion = Restrictions.Eq("GoodsID", PojoUtil.InitPojo <GoodsInfo>(goodsID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(price))
         {
             ICriterion criterion = Restrictions.Like("Price", price, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(qty))
         {
             ICriterion criterion = Restrictions.Like("Qty", qty, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("RetOrderID"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #6
0
 public ActionResult Get(int pageSize, int pageNum, string goodsCode, string goodsName, string barCode, string goodsTypeID, string modelNum)
 {
     return(Json(goodsInfoOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(goodsCode))
         {
             ICriterion criterion = Restrictions.Like("GoodsCode", goodsCode, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(goodsName))
         {
             ICriterion criterion = Restrictions.Like("GoodsName", goodsName, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(barCode))
         {
             ICriterion criterion = Restrictions.Like("BarCode", barCode, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(goodsTypeID))
         {
             ICriterion criterion = Restrictions.Eq("GoodsType", PojoUtil.InitPojo <GoodsType>(goodsTypeID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(modelNum))
         {
             ICriterion criterion = Restrictions.Like("ModelNum", modelNum, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("GoodsName"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #7
0
 public ActionResult Get(int pageSize, int pageNum, string pId, string unitDesc, string goodsTypeCode, string goodsTypeName)
 {
     return(Json(goodsTypeOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(pId))
         {
             ICriterion criterion = Restrictions.Eq("PId", new Guid(pId));
             criteria.Add(criterion);
         }
         else
         {
             ICriterion criterion = Restrictions.Eq("PId", Guid.Empty);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(unitDesc))
         {
             ICriterion criterion = Restrictions.Like("UnitDesc", unitDesc, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(goodsTypeCode))
         {
             ICriterion criterion = Restrictions.Like("GoodsTypeCode", goodsTypeCode, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(goodsTypeName))
         {
             ICriterion criterion = Restrictions.Like("GoodsTypeName", goodsTypeName, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("GoodsTypeCode"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #8
0
        //查找地址码
        public ActionResult Search(string code)
        {
            //得到地址码的级别
            int level = GetCodeLevel(code);

            IList <AddrCode> retVal = null;

            if (level >= 0)
            {
                retVal = addrCodeOper.Get(
                    delegate(object sender, ICriteria criteria)
                {
                    //模糊查找当前代码
                    ICriterion criterion = Restrictions.Like("Code", code + "__%");
                    criteria.Add(criterion);
                    //查找当前代码的一下级
                    criterion = Restrictions.Eq("Level", (byte)(level + 1));
                    criteria.Add(criterion);

                    criteria.AddOrder(Order.Asc("Code"));
                }
                    );
            }
            else
            {
                retVal = new List <AddrCode>();
            }

            return(Json(retVal));
        }
Beispiel #9
0
        public ActionResult Get(int pageSize, int pageNum, string roleFlag, string roleId, string modId)
        {
            return(Json(empModOper.Get(
                            delegate(object sender, ICriteria criteria)
            {
                if (!string.IsNullOrEmpty(roleFlag))
                {
                    ICriterion criterion = Restrictions.Eq("RoleFlag", roleFlag);
                    criteria.Add(criterion);
                }
                if (!string.IsNullOrEmpty(roleId))
                {
                    ICriterion criterion = Restrictions.Eq("RoleId", new Guid(roleId));
                    criteria.Add(criterion);
                }
                if (!string.IsNullOrEmpty(modId))
                {
                    ICriterion criterion = Restrictions.Eq("Mod", PojoUtil.InitPojo <Mod>(modId));
                    criteria.Add(criterion);
                }

                //创建对象属性别名
                criteria.CreateAlias("Mod", "m");
                criteria.AddOrder(Order.Asc("m.Name"));
            }
                            , pageSize, pageNum)));
        }
Beispiel #10
0
 public ActionResult Get(int pageSize, int pageNum, string pId, string code, string name, string addr)
 {
     return(Json(departmentOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(pId))
         {
             ICriterion criterion = Restrictions.Eq("PId", new Guid(pId));
             criteria.Add(criterion);
         }
         else
         {
             ICriterion criterion = Restrictions.Eq("PId", Guid.Empty);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(code))
         {
             ICriterion criterion = Restrictions.Eq("Code", code);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(name))
         {
             ICriterion criterion = Restrictions.Like("Name", name, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(addr))
         {
             ICriterion criterion = Restrictions.Like("Addr", addr, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("Code"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #11
0
 public ActionResult Get()
 {
     return(Json(companyOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
     }
                     , 1, 1)));
 }
Beispiel #12
0
        //由工号与密码获取用户
        private Employee GetEmpForCodeAndPwd(string code, string pwd)
        {
            Employee         retVal = null;;
            IList <Employee> emps   = employeeOper.Get(
                delegate(object sender, ICriteria criteria)
            {
                ICriterion criterion = Restrictions.Eq("Code", code);
                criteria.Add(criterion);
                criterion = Restrictions.Eq("PwdWeb", pwd);
                criteria.Add(criterion);
            }
                );

            if (emps != null && emps.Count > 0)
            {
                retVal = emps[0];
                emps.Clear();
            }
            return(retVal);
        }
Beispiel #13
0
        public ActionResult GetWorkDetail(int pageSize, int pageNum, string workSubId)
        {
            return(Json(workDetailOper.Get(
                            delegate(object sender, ICriteria criteria)
            {
                ICriterion criterion = Restrictions.Eq("WorkSub", PojoUtil.InitPojo <WorkSub>(workSubId));
                criteria.Add(criterion);

                criteria.AddOrder(Order.Desc("ModDate"));
            }
                            , pageSize, pageNum)));
        }
Beispiel #14
0
        public ActionResult GetCustomerScore(int pageSize, int pageNum, string workId)
        {
            return(Json(customerScoreOper.Get(
                            delegate(object sender, ICriteria criteria)
            {
                ICriterion criterion = Restrictions.Eq("Work", PojoUtil.InitPojo <Work>(workId));
                criteria.Add(criterion);

                criteria.AddOrder(Order.Desc("ModDate"));
            }
                            , pageSize, pageNum)));
        }
Beispiel #15
0
        public ActionResult Upload()
        {
            IList <File> retVal = new List <File>();

            string path = Server.MapPath("/") + @"Files\";

            //文件上传,一次上传1M的数据,防止出现大文件无法上传
            HttpFileCollectionBase files = Request.Files;

            for (int i = 0; i < files.Count; i++)
            {
                //保存上传的文件
                File file = SaveHttpPostFile(files[i], path);

                //查找是否存在过相同MD5值的文件,如果是则不保存到数据库
                IList <File> searchFiles = fileOper.Get(
                    delegate(object sender, ICriteria criteria)
                {
                    criteria.Add(Restrictions.Eq("Md5", file.Md5));
                }
                    );

                if (searchFiles.Count > 0)
                {
                    //删除上传的文件并把数据库相同文件信息返回
                    DelFile(file.RealPath);
                    file = searchFiles[0];
                }
                else
                {
                    //保存文件到数据库
                    fileOper.Add(file);
                }

                retVal.Add(file);
            }

            return(Json(retVal));
        }
Beispiel #16
0
 public ActionResult Get(int pageSize, int pageNum, string unitName)
 {
     return(Json(unitOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(unitName))
         {
             ICriterion criterion = Restrictions.Like("UnitName", unitName, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("UnitName"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #17
0
        public ActionResult Login(string code, string pwd)
        {
            IList <Employee> emps = empOper.Get(
                delegate(object sender, ICriteria criteria)
            {
                ICriterion criterion = Restrictions.Eq("Code", code);
                criteria.Add(criterion);
                criterion = Restrictions.Eq("Pwd", pwd);
                criteria.Add(criterion);
            }
                );

            if (emps != null && emps.Count > 0)
            {
                Session["Employee"] = emps[0];
                emps.Clear();
            }
            else
            {
//                throw new Exception("UserNameOrPwdError");//用户名或密码错误
            }
            return(Json("true"));
        }
Beispiel #18
0
 public ActionResult Get(int pageSize, int pageNum, string retOrderCode, string vendorID, string storeHouseID, string retMember, string approvalID, string approvalTime, string state, string totalMoney)
 {
     return(Json(retOrderOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(retOrderCode))
         {
             ICriterion criterion = Restrictions.Like("RetOrderCode", retOrderCode, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(vendorID))
         {
             ICriterion criterion = Restrictions.Eq("VendorID", PojoUtil.InitPojo <VendorInfo>(vendorID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(storeHouseID))
         {
             ICriterion criterion = Restrictions.Eq("StoreHouseID", PojoUtil.InitPojo <Storehouse>(storeHouseID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(retMember))
         {
             ICriterion criterion = Restrictions.Like("RetMember", retMember, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(approvalID))
         {
             ICriterion criterion = Restrictions.Eq("ApprovalID", PojoUtil.InitPojo <Employee>(approvalID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(approvalTime))
         {
             ICriterion criterion = Restrictions.Like("ApprovalTime", approvalTime, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(state))
         {
             ICriterion criterion = Restrictions.Like("State", state, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(totalMoney))
         {
             ICriterion criterion = Restrictions.Like("TotalMoney", totalMoney, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("RetOrderCode"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #19
0
 public ActionResult Get(int pageSize, int pageNum, string reqOrderCode, string srcHouseID, string destHouseID, string carrier, string approvalID, string oPerTime, string approvalTime, string state)
 {
     return(Json(reqOrderOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(reqOrderCode))
         {
             ICriterion criterion = Restrictions.Like("ReqOrderCode", reqOrderCode, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(srcHouseID))
         {
             ICriterion criterion = Restrictions.Eq("SrcHouseID", PojoUtil.InitPojo <Storehouse>(srcHouseID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(destHouseID))
         {
             ICriterion criterion = Restrictions.Eq("DestHouseID", PojoUtil.InitPojo <Storehouse>(destHouseID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(carrier))
         {
             ICriterion criterion = Restrictions.Like("Carrier", carrier, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(approvalID))
         {
             ICriterion criterion = Restrictions.Eq("ApprovalID", PojoUtil.InitPojo <Employee>(approvalID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(oPerTime))
         {
             ICriterion criterion = Restrictions.Like("OPerTime", oPerTime, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(approvalTime))
         {
             ICriterion criterion = Restrictions.Like("ApprovalTime", approvalTime, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(state))
         {
             ICriterion criterion = Restrictions.Like("State", state, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("ReqOrderCode"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #20
0
        public ActionResult Get(int pageSize, int pageNum, string cls)
        {
            return(Json(modFuncOper.Get(
                            delegate(object sender, ICriteria criteria)
            {
                if (!string.IsNullOrEmpty(cls))
                {
                    ICriterion criterion = Restrictions.Eq("Cls", cls);
                    criteria.Add(criterion);
                }

                criteria.AddOrder(Order.Asc("Cls"));
            }
                            , pageSize, pageNum)));
        }
        public IList <EmpModFunc> GetEmpModFuncs(EmpModFunc.RoleFlagVal roleFlag, Guid id)
        {
            IList <EmpModFunc> retVal = empModFuncOper.Get(
                delegate(object sender, ICriteria criteria)
            {
                ICriterion criterion = null;

                string strRoleFlag = EmpModFunc.RoleFlagValStr(roleFlag);
                criterion          = Restrictions.Eq("RoleFlag", strRoleFlag);
                criteria.Add(criterion);
                criterion = Restrictions.Eq("RoleId", id);
                criteria.Add(criterion);
            }
                );

            return(retVal);
        }
 public ActionResult Get(int pageSize, int pageNum, string storehouseID, string goodsID)
 {
     return(Json(sellPriceInfoOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(storehouseID))
         {
             ICriterion criterion = Restrictions.Eq("Storehouse", PojoUtil.InitPojo <Storehouse>(storehouseID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(goodsID))
         {
             ICriterion criterion = Restrictions.Eq("Goods", PojoUtil.InitPojo <GoodsInfo>(goodsID));
             criteria.Add(criterion);
         }
     }
                     , pageSize, pageNum)));
 }
Beispiel #23
0
 public ActionResult Get(int pageSize, int pageNum, string name, string nickname, string phoneNum, string tel, string qq, string weiXin, string email)
 {
     return(Json(customerOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(name))
         {
             ICriterion criterion = Restrictions.Like("Name", name, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(nickname))
         {
             ICriterion criterion = Restrictions.Like("Nickname", nickname, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(phoneNum))
         {
             ICriterion criterion = Restrictions.Like("PhoneNum", phoneNum, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(tel))
         {
             ICriterion criterion = Restrictions.Like("Tel", tel, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(qq))
         {
             ICriterion criterion = Restrictions.Like("QQ", qq, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(weiXin))
         {
             ICriterion criterion = Restrictions.Like("WeiXin", weiXin, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(email))
         {
             ICriterion criterion = Restrictions.Like("Email", email, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Desc("ModDate"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #24
0
        public ActionResult Get(int pageSize, int pageNum, string roleFlag, string roleId)
        {
            return(Json(photoOper.Get(
                            delegate(object sender, ICriteria criteria)
            {
                if (!string.IsNullOrEmpty(roleFlag))
                {
                    ICriterion criterion = Restrictions.Eq("RoleFlag", roleFlag);
                    criteria.Add(criterion);
                }
                if (!string.IsNullOrEmpty(roleId))
                {
                    ICriterion criterion = Restrictions.Eq("RoleId", new Guid(roleId));
                    criteria.Add(criterion);
                }

                criteria.AddOrder(Order.Asc("RoleFlag"));
            }
                            , pageSize, pageNum)));
        }
Beispiel #25
0
        public ActionResult Get(int pageSize, int pageNum, string storehouseId, string goodsId)
        {
            return(Json(stockInitOper.Get(
                            delegate(object sender, ICriteria criteria)
            {
                if (!string.IsNullOrEmpty(storehouseId))
                {
                    ICriterion criterion = Restrictions.Eq("Storehouse", PojoUtil.InitPojo <Storehouse>(storehouseId));
                    criteria.Add(criterion);
                }
                if (!string.IsNullOrEmpty(goodsId))
                {
                    ICriterion criterion = Restrictions.Eq("Goods", PojoUtil.InitPojo <GoodsInfo>(goodsId));
                    criteria.Add(criterion);
                }

                //创建对象属性别名
                criteria.CreateAlias("Storehouse", "sh");
                criteria.AddOrder(Order.Asc("sh.StoreName"));
            }
                            , pageSize, pageNum)));
        }
Beispiel #26
0
 public ActionResult Get(int pageSize, int pageNum, string name, string addr)
 {
     return(Json(gardenOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(name))
         {
             ICriterion criterion = Restrictions.Like("Name", name, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(addr))
         {
             ICriterion criterion = Restrictions.Like("Addr", addr, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Desc("ModDate"));
         criteria.AddOrder(Order.Asc("AddrCode"));
         //            ICriterion criterion = Restrictions.Eq("Name", "测试123");
         //            criteria.Add(criterion);
     }
                     , pageSize, pageNum)));
 }
Beispiel #27
0
 public ActionResult Get(int pageSize, int pageNum, string sellOrderCode, string storeHouseID, string salespersonID, string salespersonDeptID, string sellDateTime, string totalMoney)
 {
     return(Json(sellOrderOper.Get(
                     delegate(object sender, ICriteria criteria) {
         if (!string.IsNullOrEmpty(sellOrderCode))
         {
             ICriterion criterion = Restrictions.Like("SellOrderCode", sellOrderCode, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(storeHouseID))
         {
             ICriterion criterion = Restrictions.Eq("StoreHouseID", PojoUtil.InitPojo <Storehouse>(storeHouseID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(salespersonID))
         {
             ICriterion criterion = Restrictions.Eq("SalespersonID", PojoUtil.InitPojo <Employee>(salespersonID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(salespersonDeptID))
         {
             ICriterion criterion = Restrictions.Eq("SalespersonDeptID", PojoUtil.InitPojo <Department>(salespersonDeptID));
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(sellDateTime))
         {
             ICriterion criterion = Restrictions.Like("SellDateTime", sellDateTime, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(totalMoney))
         {
             ICriterion criterion = Restrictions.Like("TotalMoney", totalMoney, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("SellOrderCode"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #28
0
 public ActionResult Get(int pageSize, int pageNum, string storeCode, string storeName, string deptID)
 {
     return(Json(storehouseOper.Get(
                     delegate(object sender, ICriteria criteria)
     {
         if (!string.IsNullOrEmpty(storeCode))
         {
             ICriterion criterion = Restrictions.Like("StoreCode", storeCode, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(storeName))
         {
             ICriterion criterion = Restrictions.Like("StoreName", storeName, MatchMode.Anywhere);
             criteria.Add(criterion);
         }
         if (!string.IsNullOrEmpty(deptID))
         {
             ICriterion criterion = Restrictions.Eq("Dept", PojoUtil.InitPojo <Department>(deptID));
             criteria.Add(criterion);
         }
         criteria.AddOrder(Order.Asc("StoreName"));
     }
                     , pageSize, pageNum)));
 }
Beispiel #29
0
        public ActionResult DownLoadDept()
        {
            string fileName = Server.MapPath("/") + @"Files\Temp\"+"1.xlsx";

            IList<ExcelField> fields=new List<ExcelField>();

            ExcelField ef=null;

            ef=new ExcelField("Code","代码");
            fields.Add(ef);
            ef = new ExcelField("Name", "名字");
            fields.Add(ef);
            ef = new ExcelField("TestExcel", "测试Excel");
            fields.Add(ef);

            TbBaseOper<Department> departmentOper = new TbBaseOper<Department>(HibernateOper, typeof(Department));
            IList<Department> list=departmentOper.Get();

            //ExportExcel ee = new ExportExcel(fileName, "abc", fields);
            ExportExcel ee = new ExportExcel(fileName,typeof(Department));
            ee.Save(list);

            //返回文件
            return File(fileName, "xlsx", "1.xlsx");
        }
Beispiel #30
0
 public ActionResult Get(int pageSize, int pageNum)
 {
     return(Json(modOper.Get(Get_OnCriteria, pageSize, pageNum)));
 }