예제 #1
0
    internal void SaveTheExamInformation(ExamTitle aExamTitleObj)
    {
        try
        {
            connection.Open();
            string     selectQuery = @"INSERT INTO [tbl_exam_title_information]
       ([exti_id]
       ,[exti_name])
 VALUES
       ('" + aExamTitleObj.Id + "','" + aExamTitleObj.Name + "')";
            SqlCommand command     = new SqlCommand(selectQuery, connection);
            command.ExecuteNonQuery();
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
        finally
        {
            if (connection.State == ConnectionState.Open)
            {
                connection.Close();
            }
        }
    }
예제 #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            ExamTitle examTitle = db.ExamTitle.Find(id);

            db.ExamTitle.Remove(examTitle);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #3
0
 public ActionResult Edit(ExamTitle examTitle)
 {
     if (ModelState.IsValid)
     {
         db.Entry(examTitle).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.EducationLevelId = new SelectList(db.EducationLevel, "Id", "EducationLevelNaame", examTitle.EducationLevelId);
     return(View(examTitle));
 }
예제 #4
0
        public ActionResult Create(ExamTitle examTitle)
        {
            if (ModelState.IsValid)
            {
                db.ExamTitle.Add(examTitle);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.EducationLevelId = new SelectList(db.EducationLevel, "Id", "EducationLevelNaame", examTitle.EducationLevelId);
            return(View(examTitle));
        }
예제 #5
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ExamTitle examTitle = db.ExamTitle.Find(id);

            if (examTitle == null)
            {
                return(HttpNotFound());
            }
            return(View(examTitle));
        }
예제 #6
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ExamTitle examTitle = db.ExamTitle.Find(id);

            if (examTitle == null)
            {
                return(HttpNotFound());
            }
            ViewBag.EducationLevelId = new SelectList(db.EducationLevel, "Id", "EducationLevelNaame", examTitle.EducationLevelId);
            return(View(examTitle));
        }
예제 #7
0
        internal List <ExamTitle> GetAllExamTitleInformationForSpecificEmployee(string employeeId)
        {
            try
            {
                connection.Open();
                string           selectQuery   = @"SELECT (SELECT  [exti_name]  FROM [tbl_exam_title_information] WHERE [exti_id]=[edi_exam_title_id])
      ,[edi_institute_name]
      ,[edi_gpa]
      ,[edi_grade]
  FROM [tbl_employee_education_info] WHERE [edi_employee_id]='" + employeeId + "'";
                SqlCommand       command       = new SqlCommand(selectQuery, connection);
                SqlDataReader    reader        = command.ExecuteReader();
                List <ExamTitle> axamTitlelIST = new List <ExamTitle>();

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        ExamTitle aExamTitleObj = new ExamTitle();
                        aExamTitleObj.ExamId     = reader[0].ToString();
                        aExamTitleObj.Inistitute = reader[1].ToString();
                        aExamTitleObj.GPA        = reader[2].ToString();
                        aExamTitleObj.Grade      = reader[3].ToString();

                        axamTitlelIST.Add(aExamTitleObj);
                    }
                }
                return(axamTitlelIST);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            finally
            {
                if (connection.State == ConnectionState.Open)
                {
                    connection.Close();
                }
            }
        }
예제 #8
0
 internal void DeleteTheExam(ExamTitle aExamTitleObj)
 {
     try
     {
         connection.Open();
         string     selectQuery = @"DELETE FROM [tbl_exam_title_information] WHERE [exti_id] ='" + aExamTitleObj.Id + "'  ";
         SqlCommand command     = new SqlCommand(selectQuery, connection);
         command.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
     finally
     {
         if (connection.State == ConnectionState.Open)
         {
             connection.Close();
         }
     }
 }
예제 #9
0
      internal void UpdateTheOldExamInforation(ExamTitle aExamTitleObj)
      {
          try
          {
              connection.Open();
              string     selectQuery = @"UPDATE [tbl_exam_title_information]
 SET[exti_name] ='" + aExamTitleObj.Name + "' WHERE [exti_id] ='" + aExamTitleObj.Id + "'  ";
              SqlCommand command     = new SqlCommand(selectQuery, connection);
              command.ExecuteNonQuery();
          }
          catch (Exception ex)
          {
              throw new Exception(ex.Message);
          }
          finally
          {
              if (connection.State == ConnectionState.Open)
              {
                  connection.Close();
              }
          }
      }
예제 #10
0
 public void UpdateTheExam(ExamTitle aExamTitleObj)
 {
     aExamTitleGatewayObj.UpdateTheOldExamInforation(aExamTitleObj);
 }
예제 #11
0
 public void DeleteTheExam(ExamTitle aExamTitleObj)
 {
     aExamTitleGatewayObj.DeleteTheExam(aExamTitleObj);
 }
예제 #12
0
 public void SaveTheExamInformation(ExamTitle aExamTitleObj)
 {
     aExamTitleGatewayObj.SaveTheExamInformation(aExamTitleObj);
 }