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 }); }
public void Add(ShopJobAdModifyLog modifyLog) { db.ShopJobAdModifyLog.AddObject(modifyLog); Save(); }
/// <summary> /// 用于向 ShopJobAdModifyLog EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet<T> 属性的 .Add 方法。 /// </summary> public void AddToShopJobAdModifyLog(ShopJobAdModifyLog shopJobAdModifyLog) { base.AddObject("ShopJobAdModifyLog", shopJobAdModifyLog); }
/// <summary> /// 创建新的 ShopJobAdModifyLog 对象。 /// </summary> /// <param name="id">Id 属性的初始值。</param> /// <param name="jobId">JobId 属性的初始值。</param> /// <param name="modifyAt">ModifyAt 属性的初始值。</param> /// <param name="modifyBy">ModifyBy 属性的初始值。</param> public static ShopJobAdModifyLog CreateShopJobAdModifyLog(global::System.Int32 id, global::System.Int32 jobId, global::System.DateTime modifyAt, global::System.Int32 modifyBy) { ShopJobAdModifyLog shopJobAdModifyLog = new ShopJobAdModifyLog(); shopJobAdModifyLog.Id = id; shopJobAdModifyLog.JobId = jobId; shopJobAdModifyLog.ModifyAt = modifyAt; shopJobAdModifyLog.ModifyBy = modifyBy; return shopJobAdModifyLog; }