public static void RemoveTenant(tenant_tbl tenant) { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.Entry(tenant).State = EntityState.Deleted; db.SaveChanges(); } }
public static void RemoveUserNotification(user_notification_tbl u) { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { //db.user_notification_tbl.Remove(u); db.Entry(u).State = EntityState.Deleted; db.SaveChanges(); } }
public static void Add(notification_tbl notification) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.notification_tbl.Add(notification); db.SaveChanges(); } } catch (Exception e) { } }
public static void Add(vote_tbl vote) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.vote_tbl.Add(vote); db.SaveChanges(); } } catch (Exception e) { } }
public static void Add(survey_tbl survey) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.survey_tbl.Add(survey); db.SaveChanges(); } } catch (Exception e) { } }
public static void UpdateTenantDetails(tenant_tbl tenant) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.Entry(tenant).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch (Exception e) { throw e; } }
public static void Add(user_tbl user) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.user_tbl.Add(user); db.SaveChanges(); } } catch { throw; } }
public static void Add(session_tbl session) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { session.user_tbl = db.user_tbl.Find(session.user_id); db.session_tbl.Add(session); db.SaveChanges(); } } catch (Exception e) { } }
public static void UpdateStatus(fault_tbl fault) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.Entry(fault).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch { throw; } }
public static void Add(fault_tbl fault) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.fault_tbl.Add(fault); db.SaveChanges(); } } catch { throw; } }
public static void Add(expenditure_tbl expenditure) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.expenditure_tbl.Add(expenditure); db.SaveChanges(); } } catch (Exception ex) { throw ex; } }
public static void Add(building_tbl building) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.building_tbl.Add(building); db.SaveChanges(); } } catch { throw; } }
public static void Add(tenant_tbl tenant) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.tenant_tbl.Add(tenant); db.SaveChanges(); } } catch (Exception e) { throw e; } }
public static void UpdateCountAnswer(SurveyDetails survey) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.SurveyDetails.AddOrUpdate(survey); // db.Entry(survey).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch (Exception ex) { throw ex; } }
public static void ChangeStatus(SurveyHedear survey) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.SurveyHedear.AddOrUpdate(survey); // db.Entry(survey).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); } } catch (Exception ex) { throw ex; } }
//get all //get by id //add //update //delete //todo //public static long GetSurvey(int id) //{ // using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) // { // return db.SurveyHedears.Where(); // } //} public static long AddNewSurveyHeader(SurveyHedear surveyHedear) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.SurveyHedear.Add(surveyHedear); db.SaveChanges(); return(surveyHedear.SurveyHedearId); } } catch (Exception ex) { throw ex; } }
public static void Addpayment(payment_tbl payment) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { //db.payment_tbl.AddOrUpdate(payment); db.payment_tbl.Add(payment); db.SaveChanges(); } } catch { throw; } }
public static void AddNewSurveyDetails(ICollection <SurveyDetails> surveyDetails) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { foreach (SurveyDetails surveyDetail in surveyDetails) { db.SurveyDetails.Add(surveyDetail); } db.SaveChanges(); } } catch (Exception e) { throw; } }
public static int Add(notification_tbl notification) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.notification_tbl.Add(notification); db.SaveChanges(); return(notification.id); } return(-1); } catch (Exception e) { throw e; } }
public static void DeleteSurvey(SurveyHedear survey) { try { using (HomeCommitteeDBEntities db = new HomeCommitteeDBEntities()) { db.Entry(survey).State = EntityState.Deleted; List <SurveyDetails> sd = db.SurveyDetails.Where(s => s.SurveyHedearId == survey.SurveyHedearId).ToList(); foreach (var item in sd) { db.Entry(item).State = EntityState.Deleted; } db.SaveChanges(); } } catch (Exception e) { throw e; } }