public WrapperDocType CreateSingleDocType(DocTypeENT UserProfile) { WrapperDocType data = new WrapperDocType(); data.DocType = new DocTypeCRUD().CreateSingle(UserProfile); return(data); }
public DocTypeENT SelectSingle(int Id) { NbkDbEntities dbcontext = new NbkDbEntities(); DocType Obj = dbcontext.DocType.Where(x => x.Id == Id).FirstOrDefault(); DocTypeENT Data = new DocTypeENT() { Id = Obj.Id, PartyTypeId = Obj.PartyTypeId, DocName = Obj.DocName, isRequired = Obj.IsRequired }; return(Data); }
public DocTypeENT CreateSingle(DocTypeENT Obj) { NbkDbEntities dbcontext = new NbkDbEntities(); DocType Data = new DocType() { PartyTypeId = Obj.PartyTypeId, DocName = Obj.DocName, IsRequired = Obj.isRequired }; dbcontext.DocType.Add(Data); dbcontext.SaveChanges(); Obj.Id = Data.Id; return(Obj); }
public DocTypeENT UpdateSelectSingle(DocTypeENT Obj) { NbkDbEntities dbcontext = new NbkDbEntities(); DocType Data = new DocType() { Id = Obj.Id, PartyTypeId = Obj.PartyTypeId, DocName = Obj.DocName, IsRequired = Obj.isRequired }; dbcontext.DocType.Attach(Data); var update = dbcontext.Entry(Data); update.Property(x => x.DocName).IsModified = true; update.Property(x => x.IsRequired).IsModified = true; dbcontext.SaveChanges(); return(Obj); }