コード例 #1
0
ファイル: HomeController.cs プロジェクト: Belal-95/repos
        public int DeleteWorkDetail(string workExperienceId)
        {
            tblWorkExperienceDetail workDetail = dbEntities.tblWorkExperienceDetails.Find(int.Parse(workExperienceId));

            dbEntities.tblWorkExperienceDetails.Remove(workDetail);
            return(dbEntities.SaveChanges());
        }
コード例 #2
0
ファイル: HomeController.cs プロジェクト: Belal-95/repos
        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());;
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: Belal-95/repos
        public int AddNewWorkDetails()
        {
            tblWorkExperienceDetail model = new tblWorkExperienceDetail();

            //if (Session["UserId"] == null || Session["CvId"] == null)
            //    return RedirectToAction("Login", "Home");

            model.CvId = Convert.ToInt32(Session["CvId"]);

            dbEntities.tblWorkExperienceDetails.Add(model);

            return(dbEntities.SaveChanges());
        }