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(); } }
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)); }
public ActionResult Education(EducationalInfo edu) { if (ModelState.IsValid) { db.EducationalInfoes.Add(edu); db.SaveChanges(); return(RedirectToAction("Confirmation")); } UserAccountIDDropDownList(); return(View()); }
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)); } }
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)); }
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)); }
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); }
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)); } }
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"); } }
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)); }
public bool UpdateEducationalInfo(EducationalInfo model) { int rowAffected = _iEmployeeGateway.UpdateEducationalInfo(model); return(rowAffected > 0); }