public bool updateRecord(User user) { bool result = false; try { var record = _tsmEntity.tbl_users.Single(s => s.user_name == user.User_name); record.password = user.Password; record.role = user.Role; record.permission = user.Permission; record.is_active = user.Is_active; _tsmEntity.Set <tbl_users>().AddOrUpdate(record); _tsmEntity.SaveChanges(); result = true; return(result); } catch { return(result); } }
public bool updateRecord(Customer customer) { bool result = false; try { var record = _tsmEntity.tbl_customers.Single(s => s.short_name == customer.Short_name); record.com_name = customer.Com_name; record.com_addr = customer.Com_addr; record.contact_name = customer.Contact_name; record.contact_phone = customer.Contact_phone; record.contract = customer.Contract; record.contract_date = customer.Contract_date; record.note = customer.Note; _tsmEntity.Set <tbl_customers>().AddOrUpdate(record); _tsmEntity.SaveChanges(); result = true; return(result); } catch { return(result); } }
public List <T> getList() { return(_tsmEntity.Set <T>().ToList()); }