public static bool DeleteTask(int id) { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { Dal.Task t = db.Tasks.Find(id); t.status = false; db.SaveChanges(); return(true); } return(false); }
public TaskDTO(Dal.Task t) { this.TaskID = t.TaskID; this.TaskTypeId = t.TaskTypeId; this.Description = t.Description; this.PropertyID = t.PropertyID; this.SubPropertyID = t.SubPropertyID; this.ClassificationID = t.ClassificationID; this.ClientClassificationID = t.ClientClassificationID; this.ReportDate = t.ReportDate; this.DateForHandling = t.DateForHandling; this.IsHandled = t.IsHandled; this.HandlingDate = t.HandlingDate; this.HandlingWay = t.HandlingWay; status = t.status; }
public static bool SetClassification(int id, int classificationId) { try { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { Dal.Task task = db.Tasks.Find(id); task.ClassificationID = classificationId; db.SaveChanges(); return(true); } } catch { return(false); } }
public static bool UpdateTask(TaskDTO td) { using (ArgamanExpressEntities db = new ArgamanExpressEntities()) { Dal.Task t = db.Tasks.Find(td.TaskID); t.TaskTypeId = td.TaskTypeId; t.Description = td.Description; t.PropertyID = td.PropertyID; t.SubPropertyID = td.SubPropertyID; t.ClassificationID = td.ClassificationID; t.ClientClassificationID = td.ClientClassificationID; t.ReportDate = td.ReportDate; t.DateForHandling = td.DateForHandling; t.IsHandled = td.IsHandled; if (td.IsHandled == true) { t.status = false; } else { t.status = true; } t.HandlingDate = td.HandlingDate; t.HandlingWay = td.HandlingWay; if (td.Dock != null) { Document doc = new Document(); doc.DocCoding = td.Dock; doc.DocUser = td.TaskID; doc.type = 6; doc.DocName = td.DocName; DocumentBL.AddUserDocuments(new DocumentDTO(doc)); return(true); } db.SaveChanges(); return(true); } return(false); }
public static bool AddTask(TaskDTO td) { Dal.Task t = TaskDTO.ToDal(td); int id = TaskDAL.AddTask(t); if (id != 0) { if (td.Dock != null) { Document doc = new Document(); doc.DocCoding = td.Dock; doc.DocUser = id; doc.type = 6; doc.DocName = td.DocName; DocumentBL.AddUserDocuments(new DocumentDTO(doc)); } return(true); } return(false); }