public Gender GetGenderByID(int id) { objgender = null; objgender = DataRepository.GenderProvider.GetById(id); return objgender; }
public string UpdateGender(Gender orduser) { TransactionManager transaction = null; try { transaction = DataRepository.Provider.CreateTransaction(); transaction.BeginTransaction(); if (DataRepository.GenderProvider.Update(orduser)) { // Show proper message } else { return "Information could not be saved."; } transaction.Commit(); return "Information Update successfully."; } catch (Exception e) { transaction.Rollback(); return "Information could not be saved.Please contact Administrator."; } }