Пример #1
0
        public static int del(int id)
        {
            var obj = s.Client.Find(id);

            obj.State = false;
            return(s.SaveChanges());
        }
Пример #2
0
        public static int del(int id)
        {
            var obj = (from p in s.Supplier where p.GysID == id select p).First();

            obj.State = false;
            return(s.SaveChanges());
        }
Пример #3
0
        public int CreateAccount(string firstName, string lastName, string contact, string title, decimal amount, string notes)
        {
            var ret = 0;


            if (string.IsNullOrEmpty(firstName) || string.IsNullOrEmpty(title))
            {
                throw new ApplicationException("Account title or customer first name could not be empty");
            }

            var customer = new Domain.Customer {
                FirstName = firstName, LastName = lastName, ContactInfo = contact, CustomerId = _context.CustomerId(), IsActive = true
            };
            var account = new Domain.Account {
                AccountName = title, AccountNo = _context.AccountId(), Balance = 0.0M, IsActive = true
            };

            customer.Accounts.Add(account);

            _context.SaveChanges();
            ret = account.AccountNo;
            _log.Info($"Account {title} for {firstName} {lastName} has been created successfully");

            ExternalTransfer(account.AccountNo, amount, "Initial Deposit");


            return(ret);
        }
Пример #4
0
        //新增
        public static int caidanadd(Function cd)
        {
            StorageEntities entity = new StorageEntities();

            entity.Function.Add(cd);
            return(entity.SaveChanges());
        }
Пример #5
0
        //新增
        public static int JldwAdd(Models.JLinfo jldw)
        {
            StorageEntities b = new StorageEntities();

            b.JLinfo.Add(jldw);
            return(b.SaveChanges());
        }
Пример #6
0
        /// <summary>
        /// 产品管理新增
        /// </summary>
        /// <param name="cpgl"></param>
        /// <returns></returns>
        public static int CpGlAdd(Models.CpGlinfo cpgl)
        {
            StorageEntities b = new StorageEntities();

            b.CpGlinfo.Add(cpgl);
            return(b.SaveChanges());
        }
Пример #7
0
        //新增
        public static int SysAdminadd(Admin admin)
        {
            StorageEntities h = new StorageEntities();

            h.Admin.Add(admin);
            return(h.SaveChanges());
        }
Пример #8
0
        /// <summary>
        /// 新增
        /// </summary>
        /// <param name="s"></param>
        /// <returns></returns>
        public static int Add(Supplier s)
        {
            StorageEntities entity = new StorageEntities();

            entity.Supplier.Add(s);
            return(entity.SaveChanges());
        }
Пример #9
0
        /// <summary>
        /// 新增报损详表
        /// </summary>
        /// <param name="chuku"></param>
        /// <returns></returns>
        public static int AddBaoSuniang(BreakageDetailed xiang)
        {
            StorageEntities ent = new StorageEntities();

            ent.BreakageDetailed.Add(xiang);
            return(ent.SaveChanges());
        }
Пример #10
0
        /// <summary>
        /// 新增报损主表
        /// </summary>
        /// <param name="chuku"></param>
        /// <returns></returns>
        public static int AddBaoSun(Breakage zhu)
        {
            StorageEntities ent = new StorageEntities();

            ent.Breakage.Add(zhu);
            return(ent.SaveChanges());
        }
Пример #11
0
        //新增
        public static int SysRoleadd(SysRole role)
        {
            StorageEntities h = new StorageEntities();

            h.SysRole.Add(role);
            return(h.SaveChanges());
        }
Пример #12
0
        /// <summary>
        /// 新增出库详表
        /// </summary>
        /// <param name="chuku"></param>
        /// <returns></returns>
        public static int AddChuKuXiang(StockRemovalDetailed xiang)
        {
            StorageEntities ent = new StorageEntities();

            ent.StockRemovalDetailed.Add(xiang);
            return(ent.SaveChanges());
        }
Пример #13
0
        /// <summary>
        /// 添加入库主表
        /// </summary>
        /// <param name="zhu"></param>
        /// <returns></returns>
        public static int ADDRuku(Storage zhu)
        {
            StorageEntities ent = new StorageEntities();

            ent.Storage.Add(zhu);
            return(ent.SaveChanges());
        }
Пример #14
0
        /// <summary>
        /// 添加入库详表
        /// </summary>
        /// <param name="xiang"></param>
        /// <returns></returns>
        public static int ADDRukuXiang(StorageDetailed xiang)
        {
            StorageEntities ent = new StorageEntities();

            ent.StorageDetailed.Add(xiang);
            return(ent.SaveChanges());
        }
Пример #15
0
        /// <summary>
        /// 添加移库详表
        /// </summary>
        /// <param name="xiang"></param>
        /// <returns></returns>
        public static int AddYiKuxiang(MovementDetailed xiang)
        {
            StorageEntities ent = new StorageEntities();

            ent.MovementDetailed.Add(xiang);
            return(ent.SaveChanges());
        }
Пример #16
0
        /// <summary>
        /// 产品类别新增
        /// </summary>
        /// <param name="cplb"></param>
        /// <returns></returns>
        public static int CplbAdd(Models.CpLbinfo cplb)
        {
            StorageEntities b = new StorageEntities();

            b.CpLbinfo.Add(cplb);
            return(b.SaveChanges());
        }
Пример #17
0
        /// <summary>
        /// 新增产品类别
        /// </summary>
        /// <param name="pro"></param>
        /// <returns></returns>
        public static int ProductCategoryAdd(ProductCategory pro)
        {
            StorageEntities entities = new StorageEntities();

            entities.ProductCategory.Add(pro);
            return(entities.SaveChanges());
        }
Пример #18
0
        /// <summary>
        /// 添加移库主表
        /// </summary>
        /// <param name="zhu"></param>
        /// <returns></returns>
        public static int AddYiKu(Movement zhu)
        {
            StorageEntities ent = new StorageEntities();

            ent.Movement.Add(zhu);
            return(ent.SaveChanges());
        }
Пример #19
0
        /// <summary>
        /// 新增出库主表
        /// </summary>
        /// <param name="chuku"></param>
        /// <returns></returns>
        public static int AddChuKu(StockRemoval zhu)
        {
            StorageEntities ent = new StorageEntities();

            ent.StockRemoval.Add(zhu);
            return(ent.SaveChanges());
        }
Пример #20
0
        //新增
        public static int SysDepartadd(SysDepart depart)
        {
            StorageEntities h = new StorageEntities();

            h.SysDepart.Add(depart);
            return(h.SaveChanges());
        }
Пример #21
0
        public static int CustomerAdd(Customer C)
        {
            StorageEntities entit = new StorageEntities();

            entit.Customer.Add(C);
            return(entit.SaveChanges());
        }
Пример #22
0
        //删除
        public static int CplbDet(int id)
        {
            StorageEntities entity = new StorageEntities();
            var             obj    = (from p in entity.CpLbinfo where p.ID == id select p).First();

            obj.Delit = false;
            return(entity.SaveChanges());
        }
Пример #23
0
        /// <summary>
        /// 审核移库单
        /// </summary>
        /// <param name="danhao"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public static int YiKuShenHe(string danhao, int state)
        {
            StorageEntities ent = new StorageEntities();
            Movement        obj = ent.Movement.Find(danhao);

            obj.State = state;
            return(ent.SaveChanges());
        }
Пример #24
0
        /// <summary>
        /// 删除移库单
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int ShanChuYiKu(string id)
        {
            StorageEntities ent = new StorageEntities();
            Movement        obj = ent.Movement.Find(id);

            obj.DataState = false;
            return(ent.SaveChanges());
        }
Пример #25
0
        /// <summary>
        /// 通过审核后修改相应库存数量
        /// </summary>
        /// <param name="danhao"></param>
        /// <param name="Count"></param>
        /// <returns></returns>
        public static int RuKuSHHou(int cpid, int Count)
        {
            StorageEntities ent = new StorageEntities();
            CpGlinfo        obj = ent.CpGlinfo.Find(cpid);

            obj.CpShuLiang += Count;
            return(ent.SaveChanges());
        }
Пример #26
0
        //修改
        public static int SysDepartEit(int SysDepartID, string DepartName)
        {
            StorageEntities entity = new StorageEntities();
            var             obj    = (from p in entity.SysDepart where p.SysDepartID == SysDepartID select p).First();

            obj.DepartName = DepartName;
            return(entity.SaveChanges());
        }
Пример #27
0
        //删除
        public static int SysDepartdelete(int SysDepartID)
        {
            StorageEntities entity = new StorageEntities();
            var             obj    = (from p in entity.SysDepart where p.SysDepartID == SysDepartID select p).First();

            obj.IsDelete = false;
            return(entity.SaveChanges());
        }
Пример #28
0
        /// <summary>
        /// 审核出库单
        /// </summary>
        /// <param name="danhao"></param>
        /// <param name="state"></param>
        /// <returns></returns>
        public static int ChuKuShenHe(string danhao, int state)
        {
            StorageEntities ent = new StorageEntities();
            StockRemoval    obj = ent.StockRemoval.Find(danhao);

            obj.State = state;
            return(ent.SaveChanges());
        }
Пример #29
0
        /// <summary>
        /// 删除产品类别(改状态)
        /// </summary>
        /// <param name="PcId"></param>
        /// <returns></returns>
        public static int ProductCategoryDel(int PcId)
        {
            StorageEntities entities = new StorageEntities();
            var             obj      = (from p in entities.ProductCategory where p.Pcid == PcId select p).First();

            obj.PcState = 1;
            return(entities.SaveChanges());
        }
Пример #30
0
        /// <summary>
        /// 删除出库单
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public static int ShanChuChuKu(string id)
        {
            StorageEntities ent = new StorageEntities();
            StockRemoval    obj = ent.StockRemoval.Find(id);

            obj.DataState = false;
            return(ent.SaveChanges());
        }