Ejemplo n.º 1
0
 public int UpdateEducationalInfo(EducationalInfo anEmployee)
 {
     try
     {
         CommandObj.CommandText = "UDSP_AddEducationalInfo";
         CommandObj.CommandType = CommandType.StoredProcedure;
         CommandObj.Parameters.AddWithValue("@QualificationName", anEmployee.QualificationName);
         CommandObj.Parameters.AddWithValue("@GroupSubject", anEmployee.GroupSubject);
         CommandObj.Parameters.AddWithValue("@InstituteName", anEmployee.InstituteName);
         CommandObj.Parameters.AddWithValue("@BoardName", anEmployee.BoardName);
         CommandObj.Parameters.AddWithValue("@PassingYear", anEmployee.PassingYear);
         CommandObj.Parameters.AddWithValue("@Result", anEmployee.Result);
         CommandObj.Parameters.AddWithValue("@EmployeeId", anEmployee.EmployeeId);
         CommandObj.Parameters.Add("@RowAffected", SqlDbType.Int);
         CommandObj.Parameters["@RowAffected"].Direction = ParameterDirection.Output;
         ConnectionObj.Open();
         CommandObj.ExecuteNonQuery();
         int rowAffected = Convert.ToInt32(CommandObj.Parameters["@RowAffected"].Value);
         return(rowAffected);
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         throw new Exception("Could not Add educational Information", exception);
     }
     finally
     {
         ConnectionObj.Close();
         CommandObj.Dispose();
         CommandObj.Parameters.Clear();
     }
 }
Ejemplo n.º 2
0
 public ActionResult EditEducation(EducationalInfo edu)
 {
     if (ModelState.IsValid)
     {
         db.Entry(edu).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("DataEducation"));
     }
     UserAccountIDDropDownList(edu.UserId);
     return(View(edu));
 }
Ejemplo n.º 3
0
 public ActionResult Education(EducationalInfo edu)
 {
     if (ModelState.IsValid)
     {
         db.EducationalInfoes.Add(edu);
         db.SaveChanges();
         return(RedirectToAction("Confirmation"));
     }
     UserAccountIDDropDownList();
     return(View());
 }
Ejemplo n.º 4
0
 public ActionResult UpdateEducationalInfo(int id)
 {
     try
     {
         EducationalInfo educational = new EducationalInfo {
             EmployeeId = id
         };
         return(View(educational));
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }
Ejemplo n.º 5
0
        public ActionResult EditEducation(int id)
        {
            UserAccountIDDropDownList();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EducationalInfo edu = db.EducationalInfoes.Find(id);

            if (edu == null)
            {
                return(HttpNotFound());
            }
            return(View(edu));
        }
Ejemplo n.º 6
0
        public ActionResult DetailsEducation(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            EducationalInfo edu = db.EducationalInfoes.Find(id);

            if (edu == null)
            {
                return(HttpNotFound());
            }
            return(View(edu));
        }
Ejemplo n.º 7
0
        public EducationDetails GetEducationDetails(int ID)
        {
            EducationalInfo  E  = _db.EducationalInfo.First(x => x.Id == ID);
            EducationDetails ED = new EducationDetails
            {
                Id             = E.Id,
                percentage     = E.percentage,
                College        = E.College,
                backlogs       = E.backlogs,
                Specialization = E.Specialization,
                YOS            = E.YOS
            };

            return(ED);
        }
Ejemplo n.º 8
0
 public ActionResult UpdateEducationalInfo(int id, EducationalInfo model)
 {
     try
     {
         bool result = _iEmployeeManager.UpdateEducationalInfo(model);
         if (result)
         {
             return(RedirectToAction("MyProfile", "Home", new { id = model.EmployeeId }));
         }
         return(View(model));
     }
     catch (Exception exception)
     {
         Log.WriteErrorLog(exception);
         return(PartialView("_ErrorPartial", exception));
     }
 }
Ejemplo n.º 9
0
 public string PutEducation(int Id, EducationalInfo Edu)
 {
     try
     {
         EducationalInfo E = _db.EducationalInfo.First(x => x.Id == Edu.Id);
         E.Id             = Edu.Id;
         E.backlogs       = Edu.backlogs;
         E.College        = Edu.College;
         E.percentage     = Edu.percentage;
         E.Specialization = Edu.Specialization;
         E.YOS            = Edu.YOS;
         _db.SaveChanges();
         return("Updated Successfully");
     }
     catch (Exception e)
     {
         return("Error updating");
     }
 }
Ejemplo n.º 10
0
        public ActionResult DeleteEducation(int?id)
        {
            UserAccountIDDropDownList();
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EducationalInfo edu = db.EducationalInfoes.Find(id);

            if (edu == null)
            {
                return(HttpNotFound());
            }
            if (edu != null)
            {
                db.EducationalInfoes.Remove(edu);
                db.SaveChanges();
                return(RedirectToAction("DataEducation"));
            }
            return(View(edu));
        }
Ejemplo n.º 11
0
        public bool UpdateEducationalInfo(EducationalInfo model)
        {
            int rowAffected = _iEmployeeGateway.UpdateEducationalInfo(model);

            return(rowAffected > 0);
        }