public static int AddRecord(etblEmailSettingsM emailSetting) { using (OneFineRateEntities db = new OneFineRateEntities()) { try { OneFineRate.tblEmailSettingsM emailSettingForDb = (OneFineRate.tblEmailSettingsM)OneFineRateAppUtil.clsUtils.ConvertToObject(emailSetting, new OneFineRate.tblEmailSettingsM()); db.tblEmailSettingsMs.Add(emailSettingForDb); return(db.SaveChanges()); } catch (Exception) { throw; } } }
public static int UpdateRecord(etblEmailSettingsM eobj) { using (OneFineRateEntities db = new OneFineRateEntities()) { try { OneFineRate.tblEmailSettingsM obj = (OneFineRate.tblEmailSettingsM)OneFineRateAppUtil.clsUtils.ConvertToObject(eobj, new OneFineRate.tblEmailSettingsM()); db.tblEmailSettingsMs.Attach(obj); db.Entry(obj).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges()); } catch (Exception) { throw; } } }