public WrapperPartyType CreateSinglePartyType(PartyTypeENT UserProfile) { WrapperPartyType data = new WrapperPartyType(); data.PartyType = new PartyTypeCRUD().CreateSingle(UserProfile); return(data); }
public PartyTypeENT SelectSingle(int Id) { NbkDbEntities dbcontext = new NbkDbEntities(); PartyType Obj = dbcontext.PartyType.Where(x => x.Id == Id).FirstOrDefault(); PartyTypeENT Data = new PartyTypeENT() { Id = Obj.Id, Name = Obj.Name, IsDefault = Obj.IsDefault }; return(Data); }
public PartyTypeENT CreateSingle(PartyTypeENT Obj) { NbkDbEntities dbcontext = new NbkDbEntities(); PartyType Data = new PartyType() { Name = Obj.Name, IsDefault = Obj.IsDefault }; dbcontext.PartyType.Add(Data); dbcontext.SaveChanges(); Obj.Id = Data.Id; return(Obj); }
public PartyTypeENT UpdateSelectSingle(PartyTypeENT Obj) { NbkDbEntities dbcontext = new NbkDbEntities(); PartyType Data = new PartyType() { Id = Obj.Id, Name = Obj.Name, IsDefault = Obj.IsDefault }; dbcontext.PartyType.Attach(Data); var update = dbcontext.Entry(Data); update.Property(x => x.Name).IsModified = true; update.Property(x => x.IsDefault).IsModified = true; dbcontext.SaveChanges(); return(Obj); }