Пример #1
0
 public ActionResult Add(RentOrder rentOrder)
 {
     return(Json(rentOrderOper.Add(rentOrder,
                                   delegate(object sender, ISession session) {
         //判断是否存在领用主单号
         IsExistsCode(session, rentOrder);
     }
                                   )));
 }
Пример #2
0
 public ActionResult Add(CheckStock checkStock)
 {
     return(Json(checkStockOper.Add(checkStock,
                                    delegate(object sender, ISession session) {
         //判断是否存在盘点主单号
         IsExistsCode(session, checkStock);
     }
                                    )));
 }
Пример #3
0
 public ActionResult Add(SellOrder sellOrder)
 {
     return(Json(sellOrderOper.Add(sellOrder,
                                   delegate(object sender, ISession session) {
         //判断是否存在销售主单号
         IsExistsCode(session, sellOrder);
     }
                                   )));
 }
Пример #4
0
 public ActionResult Add(GoodsType goodsType)
 {
     return(Json(goodsTypeOper.Add(goodsType,
                                   delegate(object sender, ISession session)
     {
         //判断是否存在商品资料Code
         IsExistsCode(session, goodsType);
     }
                                   )));
 }
Пример #5
0
 public ActionResult Add(PurOrderDetail purOrderDetail)
 {
     return(Json(purOrderDetailOper.Add(purOrderDetail,
                                        delegate(object sender, ISession session)
     {
         //判断是否存在采购明细单号
         IsExistsCode(session, purOrderDetail);
     }
                                        )));
 }
Пример #6
0
 public ActionResult Add(SellPriceInfo sellPriceInfo)
 {
     return(Json(sellPriceInfoOper.Add(sellPriceInfo,
                                       delegate(object sender, ISession session)
     {
         //判断是否存在销售价格管理(商品资料子表)
         IsExists(session, sellPriceInfo);
     }
                                       )));
 }
Пример #7
0
 public ActionResult Add(CheckStockDetail checkStockDetail)
 {
     return(Json(checkStockDetailOper.Add(checkStockDetail,
                                          delegate(object sender, ISession session)
     {
         //判断是否存在盘点明细单号
         IsExistsCode(session, checkStockDetail);
     }
                                          )));
 }
Пример #8
0
 public ActionResult Add(Unit unit)
 {
     return(Json(unitOper.Add(unit,
                              delegate(object sender, ISession session)
     {
         //判断是否存在部门Code
         IsExistsName(session, unit);
     }
                              )));
 }
Пример #9
0
 public ActionResult Add(RetOrderDetail retOrderDetail)
 {
     return(Json(retOrderDetailOper.Add(retOrderDetail,
                                        delegate(object sender, ISession session)
     {
         //判断是否存在退货明细单号
         IsExistsCode(session, retOrderDetail);
     }
                                        )));
 }
Пример #10
0
 public ActionResult Add(PurOrder purOrder)
 {
     return(Json(purOrderOper.Add(purOrder,
                                  delegate(object sender, ISession session)
     {
         //判断是否存在采购主单号
         IsExistsCode(session, purOrder);
     }
                                  )));
 }
Пример #11
0
 public ActionResult Add(ModFunc modFunc)
 {
     return(Json(modFuncOper.Add(modFunc,
                                 delegate(object sender, ISession session)
     {
         //判断是否存在模块功能
         IsExists(session, modFunc);
     }
                                 )));
 }
Пример #12
0
 public ActionResult Add(SellOrderDetail sellOrderDetail)
 {
     return(Json(sellOrderDetailOper.Add(sellOrderDetail,
                                         delegate(object sender, ISession session)
     {
         //判断是否存在销售明细单号
         IsExistsCode(session, sellOrderDetail);
     }
                                         )));
 }
Пример #13
0
 public ActionResult Add(StockInit stockInit)
 {
     return(Json(stockInitOper.Add(stockInit,
                                   delegate(object sender, ISession session)
     {
         //判断是否存在库存数据
         IsExists(session, stockInit);
     }
                                   )));
 }
Пример #14
0
 public ActionResult Add(StorageAlarm storageAlarm)
 {
     return(Json(storageAlarmOper.Add(storageAlarm,
                                      delegate(object sender, ISession session)
     {
         //判断是否存在库存数据
         IsExists(session, storageAlarm);
     }
                                      )));
 }
Пример #15
0
 public ActionResult Add(Position position)
 {
     return(Json(positionOper.Add(position,
                                  delegate(object sender, ISession session)
     {
         //判断是否存在部门Code
         IsExistsCode(session, position);
     }
                                  )));
 }
Пример #16
0
 public ActionResult Add(Company company)
 {
     //根据地址码获取地址
     company.Addr = PojoUtil.GetAddrForCode(HibernateOper, company.AddrCode);
     LocationUtil.Location loc = LocationUtil.GetLocation(company.Addr + company.Location);
     if (loc != null)
     {
         company.Lat = loc.lat;
         company.Lng = loc.lng;
     }
     return(Json(companyOper.Add(company)));
 }
Пример #17
0
 public ActionResult Add(Garden garden)
 {
     //根据地址码获取地址
     garden.Addr = PojoUtil.GetAddrForCode(HibernateOper, garden.AddrCode);
     LocationUtil.Location loc = LocationUtil.GetLocation(garden.Addr + garden.Location);
     if (loc != null)
     {
         garden.Lat = loc.lat;
         garden.Lng = loc.lng;
     }
     return(Json(gardenOper.Add(garden)));
 }
Пример #18
0
 public ActionResult Add(GoodsInfo goodsInfo)
 {
     return(Json(goodsInfoOper.Add(goodsInfo,
                                   delegate(object sender, ISession session)
     {
         //判断是否存在商品资料Code
         IsExistsCode(session, goodsInfo);
         //判断是否存在商品资料BarCode
         IsExistsBarCode(session, goodsInfo);
     }
                                   )));
 }
Пример #19
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));
        }
Пример #20
0
 public ActionResult Add(VendorInfo vendorInfo)
 {
     //根据地址码获取地址
     vendorInfo.Addr = PojoUtil.GetAddrForCode(HibernateOper, vendorInfo.AddrCode);
     LocationUtil.Location loc = LocationUtil.GetLocation(vendorInfo.Addr + vendorInfo.Location);
     if (loc != null)
     {
         vendorInfo.Lat = loc.lat;
         vendorInfo.Lng = loc.lng;
     }
     return(Json(vendorInfoOper.Add(vendorInfo,
                                    delegate(object sender, ISession session)
     {
         //判断是否存在部门Code
         IsExistsCode(session, vendorInfo);
     }
                                    )));
 }
Пример #21
0
 public ActionResult Add(Employee employee)
 {
     //根据地址码获取地址
     employee.Addr = PojoUtil.GetAddrForCode(HibernateOper, employee.AddrCode);
     LocationUtil.Location loc = LocationUtil.GetLocation(employee.Addr + employee.Location);
     if (loc != null)
     {
         employee.Lat = loc.lat;
         employee.Lng = loc.lng;
     }
     return(Json(employeeOper.Add(employee,
                                  delegate(object sender, ISession session)
     {
         //判断是否存在部门Code
         IsExistsCode(session, employee);
     }
                                  )));
 }
Пример #22
0
 public ActionResult Add(Storehouse storehouse)
 {
     //根据地址码获取地址
     storehouse.Addr = PojoUtil.GetAddrForCode(HibernateOper, storehouse.AddrCode);
     LocationUtil.Location loc = LocationUtil.GetLocation(storehouse.Addr + storehouse.Location);
     if (loc != null)
     {
         storehouse.Lat = loc.lat;
         storehouse.Lng = loc.lng;
     }
     return(Json(storehouseOper.Add(storehouse,
                                    delegate(object sender, ISession session)
     {
         //判断是否存在库存Code
         IsExistsCode(session, storehouse);
     }
                                    )));
 }
Пример #23
0
 public ActionResult Add(Department department)
 {
     //根据地址码获取地址
     department.Addr = PojoUtil.GetAddrForCode(HibernateOper, department.AddrCode);
     LocationUtil.Location loc = LocationUtil.GetLocation(department.Addr + department.Location);
     if (loc != null)
     {
         department.Lat = loc.lat;
         department.Lng = loc.lng;
     }
     return(Json(departmentOper.Add(department,
                                    delegate(object sender, ISession session)
     {
         //判断是否存在部门Code
         IsExistsCode(session, department);
     }
                                    )));
 }
Пример #24
0
 public ActionResult Add(Mod mod)
 {
     return(Json(modOper.Add(mod)));
 }
Пример #25
0
 public ActionResult Add(Customer customer)
 {
     return(Json(customerOper.Add(customer)));
 }
Пример #26
0
        public void Init2()
        {
            try
            {
                //给员工初始化
                Employee e = new Employee();
                e.Code = "999";
                e.Name = "System";
                e.Pwd = "123456";
                e.Birthday = DateTime.Now;
                e.Entry = DateTime.Now;
                TbBaseOper<Employee> employeeOper = new TbBaseOper<Employee>(HibernateFactory.GetInstance(), typeof(Employee));
                employeeOper.Add(e);

                TbBaseOper<EmpModFunc> emfOper = new TbBaseOper<EmpModFunc>(HibernateFactory.GetInstance(), typeof(EmpModFunc));
                IList<ModFunc> funcs = modFuncOper.Get();

                foreach (ModFunc mf in funcs)
                {
                    EmpModFunc emf = new EmpModFunc();
                    emf.Emp = e;
                    emf.ModFunc = mf;
                    emf.FuncNames = "|Add|Update|Del|Get|";
                    emfOper.Add(emf);
                }

                TbBaseOper<EmpMod> emOper = new TbBaseOper<EmpMod>(HibernateFactory.GetInstance(), typeof(EmpMod));
                IList<Mod> mods = modOper.Get();

                foreach (Mod m in mods)
                {
                    EmpMod em = new EmpMod();
                    em.Emp = e;
                    em.Mod = m;
                    emOper.Add(em);
                }
            }
            catch (Exception e)
            {
                System.Console.WriteLine(e.Message);
            }
        }
Пример #27
0
 public ActionResult Add(EmpMod empMod)
 {
     return(Json(empModOper.Add(empMod)));
 }
Пример #28
0
 public ActionResult AddWorkCodeType2(WorkCodeType2 workCodeType2)
 {
     return(Json(workCodeType2Oper.Add(workCodeType2)));
 }
Пример #29
0
 public ActionResult Add(Photo photo)
 {
     return(Json(photoOper.Add(photo)));
 }
Пример #30
0
 public ActionResult Add(WorkCodeType workCodeType)
 {
     return(Json(workCodeTypeOper.Add(workCodeType)));
 }
Пример #31
0
 public ActionResult AddWorkCodeType1(WorkCodeType1 workCodeType1)
 {
     return(Json(workCodeType1Oper.Add(workCodeType1)));
 }