public int AddNewCv(string cvName, string cvIndustry, string cvLang) { tblUserCvDetail model = new tblUserCvDetail(); // if (Session["UserId"] == null) //return RedirectToAction("Login", "Home"); model.UserId = Convert.ToInt32(Session["UserId"]); model.CvName = cvName; model.Language = cvLang; model.Industry = cvIndustry; DateTime currentAccessedDateTime = DateTime.Now; model.LastModificationDateTime = currentAccessedDateTime; dbEntities.tblUserCvDetails.Add(model); //dbEntities.Entry(model).GetDatabaseValues(); dbEntities.SaveChanges(); //Session["CvId"] = model.CvId; int CvId = model.CvId; tblCvBasicInformation modelBasicInfo = new tblCvBasicInformation(); modelBasicInfo.CvId = CvId; dbEntities.tblCvBasicInformations.Add(modelBasicInfo); tblEducationDetail modelEdu = new tblEducationDetail(); modelEdu.CvId = CvId; dbEntities.tblEducationDetails.Add(modelEdu); tblInterestDetail modelInterest = new tblInterestDetail(); modelInterest.CvId = CvId; dbEntities.tblInterestDetails.Add(modelInterest); tblObjective modelObjective = new tblObjective(); modelObjective.CvId = CvId; dbEntities.tblObjectives.Add(modelObjective); tblQualification modelQualification = new tblQualification(); modelQualification.CvId = CvId; dbEntities.tblQualifications.Add(modelQualification); tblReferencesDetail modelReferences = new tblReferencesDetail(); modelReferences.Cvid = CvId; dbEntities.tblReferencesDetails.Add(modelReferences); tblWorkExperienceDetail modelExperience = new tblWorkExperienceDetail(); modelExperience.CvId = CvId; dbEntities.tblWorkExperienceDetails.Add(modelExperience); return(dbEntities.SaveChanges());; }
public ActionResult Update(tblQualification model) { var countries = objOras.GetEducations(); var test = countries.Where(p => p.DegreeName.ToUpper() == model.DegreeName.ToUpper()).FirstOrDefault(); QualificationDetails obj = new QualificationDetails(); if (test != null) { obj.Status = false; obj.ErrorMessage = SettingsManager.Instance.Branding == "SINDHI" ? Resources.SPMOResources.AlreadyExist : "Record already exist."; } else { obj.Status = true; obj.ErrorMessage = SettingsManager.Instance.Branding == "SINDHI" ? Resources.SPMOResources.UpdateSuccess : "Record updated successfully."; objOras.Update(model); } int pageindex = 0; var filter = countries.OrderBy(p => p.QualificationId).Skip(pageindex * PageSize).Take(PageSize); Session["users"] = countries; Session["pageindex"] = 0; obj.QualificationList = filter; return(Json(obj, JsonRequestBehavior.AllowGet)); }
public ActionResult Create(tblQualification Model) { UserId = USession.User_Id; try { Connection.GDsetQualification(Model.QualificationName, UserId, "Y"); Connection.SaveChanges(); //return View(); return(RedirectToAction("Index")); } catch (System.Data.Entity.Validation.DbEntityValidationException dbEx) { Exception raise = dbEx; foreach (var validationErrors in dbEx.EntityValidationErrors) { foreach (var validationError in validationErrors.ValidationErrors) { string message = string.Format("{0}:{1}", validationErrors.Entry.Entity.ToString(), validationError.ErrorMessage); // raise a new exception nesting // the current instance as InnerException Errorlog.ErrorManager.LogError(dbEx); raise = new InvalidOperationException(message, raise); } } throw raise; } }
internal void Update(tblQualification model) { tblQualification newobj = GetEducations().Where(p => p.QualificationId == model.QualificationId).FirstOrDefault(); newobj.DegreeName = model.DegreeName; objData.SaveChanges(); }
public int Save(tblQualification tbl) { tbl.IsDelete = false; objData.tblQualifications.Add(tbl); objData.SaveChanges(); return(tbl.QualificationId.Value); }
public ActionResult Edit(QulificationModel Model) { UserId = USession.User_Id; try { tblQualification TCtable = Connection.tblQualifications.SingleOrDefault(x => x.QualificationId == Model.QualificationId); Connection.GDModifyQualification(Model.QualificationName, Model.QualificationId, UserId); Connection.SaveChanges(); return(RedirectToAction("Index")); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(int Code) { try{ QulificationModel TModel = new QulificationModel(); tblQualification TCtable = Connection.tblQualifications.SingleOrDefault(x => x.QualificationId == Code); TModel.IsActive = TCtable.IsActive; TModel.QualificationId = TCtable.QualificationId; TModel.QualificationName = TCtable.QualificationName; return(PartialView("EditView", TModel)); } catch (Exception ex) { Errorlog.ErrorManager.LogError(ex); return(View()); } }
public ActionResult Edit(int BGId) { tblQualification tbl = objOras.GetEducations().Where(p => p.QualificationId == BGId).FirstOrDefault(); return(Json(tbl, JsonRequestBehavior.AllowGet)); }