Пример #1
0
 public ActionResult Create(ShopJobAd jobAd)
 {
     jobAd.PublishedAt = DateTime.Now;
     UserModel userModel = new UserModel();
     jobAd.PublishedBy = userModel.GetUserInfo(User.Identity.Name).Id;
     jobAd.LastModifyBy = jobAd.PublishedBy;
     jobAd.LastModifyAt = jobAd.PublishedAt;
     jobAd.DateDue = jobAd.PublishedAt.AddMonths(1);
     JobModel jobModel = new JobModel();
     jobModel.Add(jobAd);
     return RedirectToRoute("JobListOfShopOfMine", new { mine = 1 });
 }
Пример #2
0
        public ActionResult Edit(ShopJobAd jobAd)
        {
            UserModel userModel = new UserModel();
            int userId = userModel.GetUserInfo(User.Identity.Name).Id;

            JobModel jobModel = new JobModel();
            ShopJobAd shopJobAd = jobModel.GetShopJobAd(jobAd.Id);
            shopJobAd.JobTitle = jobAd.JobTitle;
            shopJobAd.ShopId = jobAd.ShopId;
            shopJobAd.LastModifyAt = DateTime.Now;
            shopJobAd.LastModifyBy = userId;
            shopJobAd.Description = jobAd.Description;
            shopJobAd.ContactPhone = jobAd.ContactPhone;
            shopJobAd.OrderIndex = jobAd.OrderIndex;
            shopJobAd.WorkPlace = jobAd.WorkPlace;
            shopJobAd.SalaryMin = jobAd.SalaryMin;
            shopJobAd.SalaryMax = jobAd.SalaryMin;
            shopJobAd.JobType = jobAd.JobType;
            jobModel.Save();

            ShopJobAdModifyLog modifyLog = new ShopJobAdModifyLog();
            modifyLog.JobId = jobAd.Id;
            modifyLog.ModifyAt = shopJobAd.LastModifyAt;
            modifyLog.ModifyBy = shopJobAd.LastModifyBy;
            jobModel.Add(modifyLog);
            return RedirectToRoute("JobListOfShopOfMine", new { mine = 1 });
        }