public CareerContentModel ConvertCareerContentToModel(career_content content)
 {
     return(new CareerContentModel()
     {
         Id = content.career_content_id,
         Content = content.content,
         Language = content.language,
         Title = content.title
     });
 }
        public ActionResult CareerDetail(CareerModel model)
        {
            using (var scope = new TransactionScope())
            {
                var career = _service.GetCareerById(model.Id);
                if (Equals(career, null))
                {
                    career = new career()
                    {
                        career_id    = 0,
                        created_date = ConvertDatetime.GetCurrentUnixTimeStamp()
                    };
                }
                career.type          = model.Type;
                career.city          = model.City;
                career.category_id   = model.CategoryId;
                career.salary_min    = model.SalaryMin;
                career.location      = model.Location;
                career.experied_date = model.ExpiredDate;
                _service.SaveCareer(career);

                int idx = 0;
                foreach (var careerContent in model.ContentList)
                {
                    var content = _service.GetCareerContentById(careerContent.Id);
                    if (Equals(content, null))
                    {
                        content = new career_content()
                        {
                            career_content_id = 0,
                            career_id         = career.career_id,
                            language          = idx
                        };
                    }
                    content.title   = careerContent.Title;
                    content.content = careerContent.Content;
                    _service.SaveCareerContent(content);
                    idx++;
                }

                scope.Complete();
            }
            return(RedirectToAction("Career"));
        }
 public void SaveCareerContent(career_content content)
 {
     CareerContentRepository.Save(content);
 }