public bool UpdateTopic(int Topic_id) { LogFileModule logFileModule = new LogFileModule(); String LogData = ""; db.Configuration.LazyLoadingEnabled = false; try { var Topic = db.M_Topic.First(x => x.Topic_Id == Topic_id); if (Topic.Topic_Status == 1) { Topic.Topic_Status = 2; } else if (Topic.Topic_Status == 2) { Topic.Topic_Status = 1; } db.Entry(Topic).State = System.Data.EntityState.Modified; db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(Topic, logFileModule.settings); logFileModule.logfile(10, "تعديل حالة الموضوع", "Update Topic stats", LogData); } catch (Exception e) { return(false); } return(true); }
public bool DeleteStudents(int StudentID) { LogFileModule logFileModule = new LogFileModule(); String LogData = ""; string str_En = string.Empty, str_Ar = string.Empty; try { db.Configuration.LazyLoadingEnabled = false; Student Stu = db.Students.First(x => x.Student_Id == StudentID); if (Stu.Suspended == null || Stu.Suspended == 0) { Stu.Suspended = 1; str_En = "Delete Student"; str_Ar = "حذف طالب"; } else { Stu.Suspended = 0; str_En = "Restore Student"; str_Ar = "استعادة طالب"; } db.Entry(Stu).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(Stu, logFileModule.settings); logfile(10, str_Ar, str_En, LogData); } catch (Exception e) { return(false); } return(true); }
public static string DeleteEmplooye(int Employee_Id) { string returnDeleteEmp = "0"; LogFileModule logFileModule = new LogFileModule(); String LogData = ""; try { ECMSEntities db = new ECMSEntities(); var widgets = db.Employee_Structure.Where(x => x.Employee_Id == Employee_Id).ToList(); if (widgets.Count > 0) { foreach (Employee_Structure widget in widgets) { db.Employee_Structure.Remove(widget); } } var DelEmp = db.Employees.First(x => x.Employee_Id == Employee_Id); db.Employees.Remove(DelEmp); db.SaveChanges(); returnDeleteEmp = "1"; /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(DelEmp, logFileModule.settings); logFileModule.logfile(10, "حذف الموظف", "Delete Employee", LogData); } catch (Exception e) { } return(JsonConvert.SerializeObject(returnDeleteEmp)); }
public bool DeleteMetting(int Meeting_id) { LogFileModule logFileModule = new LogFileModule(); String LogData = ""; db.Configuration.LazyLoadingEnabled = false; try { var M_Topic = db.M_Topic.Where(x => x.Meeting_Id == Meeting_id).ToList(); if (M_Topic.Count == 0) { var widgets = db.M_M_Attachments.Where(x => x.Meeting_Id == Meeting_id).ToList(); if (widgets.Count > 0) { foreach (M_M_Attachments widget in widgets) { db.M_M_Attachments.Remove(widget); } } db.SaveChanges(); var DelMeeting = db.M_Meeting.First(x => x.Meeting_Id == Meeting_id); db.M_Meeting.Remove(DelMeeting); db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(DelMeeting, logFileModule.settings); logFileModule.logfile(10, "حذف الإجتماع", "Delete Meeting", LogData); } } catch (Exception e) { return(false); } return(true); }
public bool DeleteFileID(int FileID, int studentID) { LogFileModule logFileModule = new LogFileModule(); String LogData = ""; string str_En = string.Empty, str_Ar = string.Empty; try { db.Configuration.LazyLoadingEnabled = false; File file = db.Files.First(x => x.File_Id == FileID); file.Student_Id = studentID; str_En = "Delete File"; str_Ar = "حذف ملف"; db.Entry(file).State = System.Data.Entity.EntityState.Deleted; db.SaveChanges(); file.Student_Id = studentID; /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(file, logFileModule.settings); logfile(10, str_Ar, str_En, LogData); } catch (Exception e) { return(false); } return(true); }
public bool UpateMetting(int Meeting_id) { LogFileModule logFileModule = new LogFileModule(); String LogData = ""; db.Configuration.LazyLoadingEnabled = false; try { var Meeting = db.M_Meeting.First(x => x.Meeting_Id == Meeting_id); if (Meeting.Meeting_Status == 1) { Meeting.Meeting_Status = 2; } else if (Meeting.Meeting_Status == 2) { Meeting.Meeting_Status = 3; } else if (Meeting.Meeting_Status == 3) { Meeting.Meeting_Status = 1; } db.Entry(Meeting).State = System.Data.EntityState.Modified; db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(Meeting, logFileModule.settings); logFileModule.logfile(10, "تعيل حالة الإجتماع", "Update Meeting Stats", LogData); } catch (Exception e) { return(false); } return(true); }
public bool DeleteMetting(int Meeting_id) { LogFileModule logFileModule = new LogFileModule(); String LogData = ""; try { var DelMeeting = db.M_Meeting.First(x => x.Meeting_Id == Meeting_id); db.M_Meeting.Remove(DelMeeting); db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(DelMeeting, logFileModule.settings); logFileModule.logfile(10, "حذف الإجتماع", "Delete Meeting", LogData); } catch (Exception e) { return(false); } return(true); }
public bool DeleteTopic(int Topic_id) { LogFileModule logFileModule = new LogFileModule(); String LogData = ""; db.Configuration.LazyLoadingEnabled = false; try { var DelTopic = db.M_Topic.First(x => x.Topic_Id == Topic_id); db.M_Topic.Remove(DelTopic); db.SaveChanges(); /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(DelTopic, logFileModule.settings); logFileModule.logfile(10, "حذف الموضوع", "Delete Topic", LogData); } catch (Exception e) { return(false); } return(true); }
public static string DeleteEmplooye(int Employee_Id) { string returnDeleteEmp = "0"; LogFileModule logFileModule = new LogFileModule(); String LogData = ""; try { REU_RegistrationEntities db = new REU_RegistrationEntities(); var DelEmp = db.Employees.First(x => x.Employee_Id == Employee_Id); db.Employees.Remove(DelEmp); db.SaveChanges(); returnDeleteEmp = "1"; // Add it to log file LogData = "data:" + JsonConvert.SerializeObject(DelEmp, logFileModule.settings); logFileModule.logfile(10, "حذف الموظف", "Delete Employee", LogData); } catch (Exception e) { } return(JsonConvert.SerializeObject(returnDeleteEmp)); }
public static string DeleteEmplooye(int AjaxSpecialization_Id) { string returnDeleteEmp = "0"; LogFileModule logFileModule = new LogFileModule(); String LogData = ""; try { REU_RegistrationEntities db = new REU_RegistrationEntities(); var DelSep = db.Specializations.First(x => x.Specialization_Id == AjaxSpecialization_Id); db.Specializations.Remove(DelSep); db.SaveChanges(); returnDeleteEmp = "1"; /* Add it to log file */ LogData = "data:" + JsonConvert.SerializeObject(DelSep, logFileModule.settings); logFileModule.logfile(10, "حذف التخصص", "Delete Specialization", LogData); } catch (Exception e) { } return(JsonConvert.SerializeObject(returnDeleteEmp)); }