Exemplo n.º 1
0
 public void SaveWorkExperience(WorkExperience WorkExperience)
 {
     if (WorkExperience.Id == 0)
     {
         _RWorkExperience.Add(WorkExperience);
     }
     else
     {
         _uow.Entry(WorkExperience).State = EntityState.Modified;
     }
     _uow.SaveChanges();
 }
Exemplo n.º 2
0
        public ActionResult SavePost(int Id,int GroupId ,string LongDes , string title ,string metaDescription ,string keywords, string alts)
        {
            if (IsValidSessions())
            {
                WorkExperience workExperience = _RWorkExperience.DetailsWorkExperience(Id);
                if (workExperience==null)
                {
                workExperience = new WorkExperience();
                workExperience.LongDes = LongDes;
                workExperience.WorkExperienceGroupId = GroupId;
                workExperience.CreationDate = DateTime.Now.Date;

                workExperience.title = title;
                workExperience.metaDescription = metaDescription;
                workExperience.keyWords = keywords;

                }
                else
                {
                    workExperience.LongDes = LongDes;
                    workExperience.ModifiedDate = DateTime.Now.Date;

                    workExperience.title = title;
                    workExperience.metaDescription = metaDescription;
                    workExperience.keyWords = keywords;
                }

                try
                {
                    if (workExperience.WorkExperiencesGallery != null && workExperience.WorkExperiencesGallery.Any())
                    {
                        var i = 0;
                        var altsArray = alts.Split(new string[] { "|" }, StringSplitOptions.None);
                        foreach (var item in workExperience.WorkExperiencesGallery)
                        {
                            item.alt = altsArray[i++];
                            _RWorkExperience.SaveWorkExperienceGallery(item);
                        }
                    }
                }
                catch
                {

                }

                _RWorkExperience.SaveWorkExperience(workExperience);
                TempData["Folder"] = workExperience.Id;
                return Json(new { Idms = workExperience.Id }, JsonRequestBehavior.AllowGet);
            }
            else
                return RedirectToAction("Login", "Home");
        }
Exemplo n.º 3
0
 public void DeleteWorkExperience(WorkExperience WorkExperience)
 {
     _RWorkExperience.Remove(WorkExperience);
     _uow.SaveChanges();
 }