コード例 #1
0
        public bool Save(UnitList unitlist, out string strResult)
        {
            strResult = string.Empty;
            bool result            = false;
            IQueryable <Unit> unit = UnitRepository.GetQueryable();
            var u1 = UnitRepository.GetQueryable().FirstOrDefault(un => un.UnitCode == unitlist.UnitCode01);
            var u2 = UnitRepository.GetQueryable().FirstOrDefault(un => un.UnitCode == unitlist.UnitCode01);
            var u3 = UnitRepository.GetQueryable().FirstOrDefault(un => un.UnitCode == unitlist.UnitCode01);
            var u4 = UnitRepository.GetQueryable().FirstOrDefault(un => un.UnitCode == unitlist.UnitCode01);
            var ul = UnitListRepository.GetQueryable().FirstOrDefault(u => u.UnitListCode == unitlist.UnitListCode);

            ul.UnitListCode = unitlist.UnitListCode;
            ul.UniformCode  = unitlist.UniformCode;
            ul.UnitListName = unitlist.UnitListCode;
            ul.UnitCode01   = unitlist.UnitCode01;
            ul.Quantity01   = Convert.ToInt32(unitlist.Quantity01);
            ul.UnitCode02   = unitlist.UnitCode02;
            ul.Quantity02   = Convert.ToInt32(unitlist.Quantity02);
            ul.UnitCode03   = unitlist.UnitCode03;
            ul.Quantity03   = Convert.ToInt32(unitlist.Quantity03);
            ul.UnitCode04   = unitlist.UnitCode04;
            ul.IsActive     = unitlist.IsActive;
            ul.UpdateTime   = DateTime.Now;
            UnitListRepository.SaveChanges();
            return(true);
        }
コード例 #2
0
ファイル: UnitListService.cs プロジェクト: tw0r2/wms_rfid
        public bool Delete(string unitlistCode)
        {
            var unitlist = UnitListRepository.GetQueryable()
                           .FirstOrDefault(b => b.UnitListCode == unitlistCode);

            if (unitlistCode != null)
            {
                UnitListRepository.Delete(unitlist);
                UnitListRepository.SaveChanges();
            }
            else
            {
                return(false);
            }
            return(true);
        }
コード例 #3
0
ファイル: UnitListService.cs プロジェクト: tw0r2/wms_rfid
        public bool Save(UnitList unitlist)
        {
            var ul = UnitListRepository.GetQueryable().FirstOrDefault(u => u.UnitListCode == unitlist.UnitListCode);

            ul.UnitListCode = unitlist.UnitListCode;
            ul.UniformCode  = unitlist.UniformCode;
            ul.UnitListName = unitlist.UnitListCode;
            ul.UnitCode01   = unitlist.UnitCode01;
            ul.Quantity01   = Convert.ToInt32(unitlist.Quantity01);
            ul.UnitCode02   = unitlist.UnitCode02;
            ul.Quantity02   = Convert.ToInt32(unitlist.Quantity02);
            ul.UnitCode03   = unitlist.UnitCode03;
            ul.Quantity03   = Convert.ToInt32(unitlist.Quantity03);
            ul.UnitCode04   = unitlist.UnitCode04;
            ul.IsActive     = unitlist.IsActive;
            ul.UpdateTime   = DateTime.Now;
            UnitListRepository.SaveChanges();
            return(true);
        }
コード例 #4
0
ファイル: UnitListService.cs プロジェクト: tw0r2/wms_rfid
        public new bool Add(UnitList unitlist)
        {
            var ul = new UnitList();

            ul.UnitListCode = unitlist.UnitListCode;
            ul.UniformCode  = unitlist.UniformCode;
            ul.UnitListName = unitlist.UnitListName;
            ul.UnitCode01   = unitlist.UnitCode01;
            ul.Quantity01   = Convert.ToInt32(unitlist.Quantity01);
            ul.UnitCode02   = unitlist.UnitCode02;
            ul.Quantity02   = Convert.ToInt32(unitlist.Quantity02);
            ul.UnitCode03   = unitlist.UnitCode03;
            ul.Quantity03   = Convert.ToInt32(unitlist.Quantity03);
            ul.UnitCode04   = unitlist.UnitCode04;
            ul.IsActive     = unitlist.IsActive;
            ul.UpdateTime   = DateTime.Now;
            UnitListRepository.Add(ul);
            UnitListRepository.SaveChanges();
            return(true);
        }