public static int del(int id) { var obj = s.Client.Find(id); obj.State = false; return(s.SaveChanges()); }
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()); }
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); }
//新增 public static int caidanadd(Function cd) { StorageEntities entity = new StorageEntities(); entity.Function.Add(cd); return(entity.SaveChanges()); }
//新增 public static int JldwAdd(Models.JLinfo jldw) { StorageEntities b = new StorageEntities(); b.JLinfo.Add(jldw); return(b.SaveChanges()); }
/// <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()); }
//新增 public static int SysAdminadd(Admin admin) { StorageEntities h = new StorageEntities(); h.Admin.Add(admin); return(h.SaveChanges()); }
/// <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()); }
/// <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()); }
/// <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()); }
//新增 public static int SysRoleadd(SysRole role) { StorageEntities h = new StorageEntities(); h.SysRole.Add(role); return(h.SaveChanges()); }
/// <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()); }
/// <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()); }
/// <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()); }
/// <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()); }
/// <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()); }
/// <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()); }
/// <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()); }
/// <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()); }
//新增 public static int SysDepartadd(SysDepart depart) { StorageEntities h = new StorageEntities(); h.SysDepart.Add(depart); return(h.SaveChanges()); }
public static int CustomerAdd(Customer C) { StorageEntities entit = new StorageEntities(); entit.Customer.Add(C); return(entit.SaveChanges()); }
//删除 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()); }
/// <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()); }
/// <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()); }
/// <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()); }
//修改 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()); }
//删除 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()); }
/// <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()); }
/// <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()); }
/// <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()); }