public bool SaveTaskInfo(CalanderModel model) { try { CalanderModel Task = new CalanderModel(); Task.UserId = "Rubel"; Task.Event = model.Event; Task.Titel = model.Titel; Task.Description = model.Description; Task.Date = model.Date; Task.Status = true; _data.Calander.Add(Task); _data.SaveChanges(); return(true); } catch { return(false); } }
public bool Postedit(CalanderModel model) { try { _data.Entry(model).State = EntityState.Modified; _data.SaveChanges(); return(true); } catch { return(false); } }
public CalanderModel Detail(int id) { CalanderModel Task = new CalanderModel(); try { Task = _data.Calander.FirstOrDefault(x => x.Id == id && x.UserId == "Rubel"); return(Task); } catch { return(Task); } }
public bool Status(int id) { CalanderModel Task = new CalanderModel(); try { Task = _data.Calander.FirstOrDefault(x => x.Id == id && x.UserId == "Rubel"); Task.Status = false; _data.SaveChanges(); return(true); } catch { return(false); } }
public bool SaveJobInfo(JobModel model) { try { model.Status = "Not Reply Yet"; model.UserId = "Rubel"; model.ApplyDate = DateTime.Now; model.NextAction = "Follow up on the application"; _data.jobs.Add(model); _data.SaveChanges(); JobHistoryModel history = new JobHistoryModel(); history.UserId = "Rubel"; history.JobId = model.Id.ToString(); history.ActionDate = DateTime.Now; history.NextAction = "Follow up on the application"; history.NextActionDate = model.Date; history.ActionDetails = "Follow up on the application"; _data.JobHistory.Add(history); CalanderModel MyCalander = new CalanderModel(); MyCalander.UserId = "Rubel"; MyCalander.Titel = "Follow up on the application"; MyCalander.Description = "Position: " + model.Position + ". " + "Company :" + model.Company + ". " + "Address :" + model.Address + ". " + "Contac :" + model.ContacInfo + ". " + "Deadline :" + model.Date; MyCalander.Event = "Job Application"; MyCalander.Date = model.Date; MyCalander.Status = true; _data.Calander.Add(MyCalander); _data.SaveChanges(); return(true); } catch { return(false); } }
public ActionResult CustomersPage(int?id) { int SessionId = Convert.ToInt32(Session["UserID"]); id = SessionId == id || id == null ? SessionId : id; CustomerModel customer = db.Customers.SingleOrDefault(c => c.ID == id); if (customer == null) { return(HttpNotFound()); } List <CalanderModel> EventList = Events.Eventsdb.Where(x => x.Customer == customer.FirstName + " " + customer.LastName).ToList(); CalanderModel cal = new CalanderModel { Price = EventList.Sum(x => x.Price) }; EventList.Add(cal); var tuple = new Tuple <CustomerModel, List <CalanderModel> >(customer, EventList); return(View(tuple)); }
public JsonResult SaveEvent(CalanderModel e) { var status = false; using (MyContext dc = new MyContext()) { if (e.EventID > 0) { //Update the event var v = dc.Eventsdb.Where(a => a.EventID == e.EventID).FirstOrDefault(); if (v != null) { v.Subject = e.Subject; v.StartTime = e.StartTime; v.EndTime = e.EndTime; v.Description = e.Description; v.ThemeColor = e.ThemeColor; v.Customer = e.Customer; } } else { if (e.Description == null) { e.Description = "אין"; } dc.Eventsdb.Add(e); } dc.SaveChanges(); status = true; } return(new JsonResult { Data = new { status } }); }
private void btnCalander_Click(object sender, RoutedEventArgs e) { DataContext = new CalanderModel(); }
public ActionResult Edit(CalanderModel model) { bool Result = _Calander.Postedit(model); return(Content(Result.ToString())); }
public ActionResult CreateNewTasks(CalanderModel model) { bool Result = _Calander.SaveTaskInfo(model); return(Content(Result.ToString())); }