public tblVendorData Get(int id) { tblVendorData data = null; try { using (var dbContext = new PMSEntities()) { data = dbContext.tblVendorDatas.Where(x => x.Id == id).ToList().FirstOrDefault(); } } catch (Exception ex) { } return(data); }
public int Update(tblVendorData data) { try { using (var dbContext = new PMSEntities()) { dbContext.tblVendorDatas.Attach(data); dbContext.Entry(data).State = EntityState.Modified; dbContext.SaveChanges(); } return(1); } catch (Exception ex) { return(0); } }
public int Insert(tblVendorData data) { try { using (var dbContext = new PMSEntities()) { data.VendorId = Guid.NewGuid(); dbContext.tblVendorDatas.Add(data); dbContext.SaveChanges(); } return(1); } catch (Exception ex) { return(0); } }