コード例 #1
0
 public static bool Delete(int id, string curentUsername, string role)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_User obj = exMana.HDS_User.First(temp => temp.Usr_ID == id);
         if (curentUsername == obj.Usr_Username)
         {
             errMsg = "You can't to delete yourself !";
             return false;
         }
         if (!role.Equals("AdmExastExaor") || !role.Equals("Manager"))
         {
             errMsg = "You don't permission to delete this user !";
             return false;
         }
         exMana.DeleteObject(obj);
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #2
0
 public static bool AddNew(HDS_StandardRating Rat)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         exMana.AddToHDS_StandardRating(Rat);
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #3
0
 public static bool AddNew(HDS_TypeQuestion Typ)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         exMana.AddToHDS_TypeQuestion(Typ);
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #4
0
 public static bool AddNew(HDS_InitExamDetail Iexd)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         exMana.AddToHDS_InitExamDetail(Iexd);
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #5
0
 public static bool Update(HDS_Employee Emp)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_Employee obj = exMana.HDS_Employee.First(temp => temp.Emp_ID == Emp.Emp_ID);
         obj.Emp_Name = Emp.Emp_Name;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #6
0
 public static bool Update(HDS_TypeQuestion Typ)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_TypeQuestion obj = exMana.HDS_TypeQuestion.First(temp => temp.typ_ID == Typ.typ_ID);
         obj.Typ_Name = Typ.Typ_Name;
         obj.Typ_Description = Typ.Typ_Description;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #7
0
 public static bool Update(HDS_ExamDetailAnswer Exda)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_ExamDetailAnswer obj = exMana.HDS_ExamDetailAnswer.First(temp => temp.Exda_ID == Exda.Exda_ID);
         obj.Exd_ID = Exda.Exd_ID;
         obj.Exda_Answer = Exda.Exda_Answer;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #8
0
 public static bool Update(HDS_Category cat)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_Category obj = exMana.HDS_Category.First(temp => temp.Cat_ID == cat.Cat_ID);
         obj.Cat_Name = cat.Cat_Name;
         obj.Cat_Description = cat.Cat_Description;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #9
0
 public static bool Update(HDS_Lever lev)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_Lever obj = exMana.HDS_Lever.First(temp => temp.Lev_ID == lev.Lev_ID);
         obj.Lev_Name = lev.Lev_Name;
         obj.Lev_Description = lev.Lev_Description;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #10
0
 public static bool Update(HDS_InitExamDetail Iexd)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_InitExamDetail obj = exMana.HDS_InitExamDetail.First(temp => temp.Iex_ID == Iexd.Iex_ID);
         obj.Iex_ID = Iexd.Iex_ID;
         obj.Lev_ID = Iexd.Lev_ID;
         obj.Iexd_NumQuestion = Iexd.Iexd_NumQuestion;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #11
0
 public static bool Update(HDS_Answer Ans)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_Answer obj = exMana.HDS_Answer.First(temp => temp.Ans_ID == Ans.Ans_ID);
         obj.Que_ID = Ans.Que_ID;
         obj.Ans_Answer = Ans.Ans_Answer;
         obj.Ans_IsTrue = Ans.Ans_IsTrue;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #12
0
 public static bool Update(HDS_Question Que)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_Question obj = exMana.HDS_Question.First(temp => temp.Que_ID == Que.Que_ID);
         obj.Lev_ID = Que.Lev_ID;
         obj.Cat_ID = Que.Cat_ID;
         obj.Typ_ID = Que.Typ_ID;
         obj.Que_Title = Que.Que_Title;
         obj.Que_Description = Que.Que_Description;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #13
0
 public static bool Update(HDS_StandardRating Rat)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_StandardRating obj = exMana.HDS_StandardRating.First(temp => temp.Iex_ID == Rat.Iex_ID);
         obj.Iex_ID = Rat.Iex_ID;
         obj.Rat_FromMark = Rat.Rat_FromMark;
         obj.Rat_ToMark = Rat.Rat_ToMark;
         obj.Rat_Name = Rat.Rat_Name;
         obj.Rat_Description = Rat.Rat_Description;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #14
0
 public static bool Update(HDS_Exam Exa)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_Exam obj = exMana.HDS_Exam.First(temp => temp.Exa_ID == Exa.Exa_ID);
         obj.Emp_ID = Exa.Emp_ID;
         obj.Exa_FromDate = Exa.Exa_FromDate;
         obj.Exa_ToDate = Exa.Exa_ToDate;
         obj.Res_rating = Exa.Res_rating;
         obj.Res_Result = Exa.Res_Result;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #15
0
 public static bool Delete(int id, string role)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_StandardRating obj = exMana.HDS_StandardRating.First(temp => temp.Rat_ID == id);
         if (!role.Equals("AdmRatstrator") || !role.Equals("Manager"))
         {
             errMsg = "You don't permission to delete this user !";
             return false;
         }
         exMana.DeleteObject(obj);
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #16
0
 public static bool Update(HDS_InitExam Ini)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_InitExam obj = exMana.HDS_InitExam.First(temp => temp.Iex_ID == Ini.Iex_ID);
         obj.Iex_Name = Ini.Iex_Name;
         obj.Iex_Description = Ini.Iex_Description;
         obj.Iex_Date = Ini.Iex_Date;
         obj.Lev_ID = Ini.Lev_ID;
         obj.Cat_ID = Ini.Cat_ID;
         obj.Typ_ID = Ini.Typ_ID;
         obj.Iex_NumQuestion = Ini.Iex_NumQuestion;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }
コード例 #17
0
 public static bool Update(HDS_User Usr)
 {
     try
     {
         ExamSystemManagerDBEntities exMana = new ExamSystemManagerDBEntities();
         HDS_User obj = exMana.HDS_User.First(temp => temp.Usr_ID == Usr.Usr_ID);
         obj.Emp_ID = Usr.Emp_ID;
         obj.Usr_Username = Usr.Usr_Username;
         obj.Usr_Password = Usr.Usr_Password;
         obj.Usr_Role = Usr.Usr_Role;
         obj.Usr_Avata = Usr.Usr_Avata;
         exMana.SaveChanges();
     }
     catch (Exception e)
     {
         errMsg = e.Message;
         return false;
     }
     errMsg = "";
     return true;
 }