Esempio n. 1
0
 public void saveUser(user u)
 {
     using (var dbContext = new Service_Requests_Data_GOVEntities())
     {
         dbContext.users.Add(u);
         dbContext.SaveChanges();
     }
 }
Esempio n. 2
0
        public void addAction(action a)
        {
            DateTime date = DateTime.Now;

            a.action_description = date.ToString() + ": " + SessionInfo.userName + " " + a.action_description;
            using (var dbContext = new Service_Requests_Data_GOVEntities())
            {
                dbContext.actions.Add(a);
                dbContext.SaveChanges();
            }
        }
Esempio n. 3
0
 public void toggleIssueStatusTo(bool status, int issueId)
 {
     using (var dbContext = new Service_Requests_Data_GOVEntities())
     {
         var result = dbContext.issues.SingleOrDefault(i => i.issue_id == issueId);
         if (result != null)
         {
             result.issue_ongoing = status;
             dbContext.SaveChanges();
         }
     }
 }
Esempio n. 4
0
 public void updateReminder(int issueId, int userId, DateTime date, Boolean status)
 {
     using (var dbContext = new Service_Requests_Data_GOVEntities())
     {
         reminder rem = dbContext.reminders.SingleOrDefault(r => r.reminder_issue_id == issueId && r.reminder_user_id == userId);
         if (rem != null)
         {
             rem.remider_date     = date;
             rem.reminder_enabled = status;
             dbContext.SaveChanges();
         }
     }
 }
Esempio n. 5
0
 public void updateIssueData(int issueId, string description, string name, string id, string tel, int issueTypeId)
 {
     using (var dbContext = new Service_Requests_Data_GOVEntities())
     {
         issue isue = dbContext.issues.SingleOrDefault(i => i.issue_id == issueId);
         if (isue != null)
         {
             isue.issue_description = description;
             isue.issuer_name       = name;
             isue.issuer_id         = id;
             isue.issuer_tel        = tel;
             isue.issue_type_id     = issueTypeId;
             dbContext.SaveChanges();
         }
     }
 }
Esempio n. 6
0
 public int saveIssue(issue i)
 {
     try
     {
         using (var dbContext = new Service_Requests_Data_GOVEntities())
         {
             dbContext.issues.Add(i);
             dbContext.SaveChanges();
             return(1);
         }
     }
     catch
     {
         return(0);
     }
 }
Esempio n. 7
0
        public void saveReminder(int issueId, int userId, DateTime date, bool status)
        {
            using (var dbContext = new Service_Requests_Data_GOVEntities())
            {
                reminder re = dbContext.reminders.SingleOrDefault(r => r.reminder_issue_id == issueId && r.reminder_user_id == userId);

                if (re == null)
                {
                    reminder remind = new reminder();
                    remind.reminder_issue_id = issueId;
                    remind.reminder_user_id  = userId;
                    remind.remider_date      = date;
                    remind.reminder_enabled  = status;
                    dbContext.reminders.Add(remind);
                    dbContext.SaveChanges();
                }
                else
                {
                    updateReminder(issueId, userId, date, status);
                }
            }
        }