public LeadQuestionsMaster UpdateLeadQuestionsMaster(LeadQuestionsMaster objLeadQuestionsMaster) { try { objLeadQuestionsMaster.updateDate = DateTime.Now; using (var context = new FitnessCenterEntities()) { context.LeadQuestionsMasters.Attach(context.LeadQuestionsMasters.Single(varL => varL.ID == objLeadQuestionsMaster.ID)); context.LeadQuestionsMasters.ApplyCurrentValues(objLeadQuestionsMaster); context.SaveChanges(); return(objLeadQuestionsMaster); } } catch (Exception ex) { throw ex; } }
public LeadQuestionsMaster InsertLeadQuestionsMaster(LeadQuestionsMaster objLeadQuestionsMaster) { try { objLeadQuestionsMaster.insertDate = DateTime.Now; objLeadQuestionsMaster.isActive = true; objLeadQuestionsMaster.isDeleted = false; using (var context = new FitnessCenterEntities()) { context.LeadQuestionsMasters.AddObject(objLeadQuestionsMaster); context.SaveChanges(); return(objLeadQuestionsMaster); } } catch (Exception ex) { throw ex; } }