Esempio n. 1
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 });
        }
Esempio n. 2
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 });
 }
Esempio n. 3
0
 public void Add(ShopJobAd jobAds)
 {
     db.ShopJobAd.AddObject(jobAds);
     Save();
 }
Esempio n. 4
0
 /// <summary>
 /// 用于向 ShopJobAd EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToShopJobAd(ShopJobAd shopJobAd)
 {
     base.AddObject("ShopJobAd", shopJobAd);
 }
Esempio n. 5
0
 /// <summary>
 /// 创建新的 ShopJobAd 对象。
 /// </summary>
 /// <param name="id">Id 属性的初始值。</param>
 /// <param name="shopId">ShopId 属性的初始值。</param>
 /// <param name="jobTitle">JobTitle 属性的初始值。</param>
 /// <param name="salaryMin">SalaryMin 属性的初始值。</param>
 /// <param name="salaryMax">SalaryMax 属性的初始值。</param>
 /// <param name="contactPhone">ContactPhone 属性的初始值。</param>
 /// <param name="description">Description 属性的初始值。</param>
 /// <param name="publishedAt">PublishedAt 属性的初始值。</param>
 /// <param name="dateDue">DateDue 属性的初始值。</param>
 /// <param name="publishedBy">PublishedBy 属性的初始值。</param>
 /// <param name="orderIndex">OrderIndex 属性的初始值。</param>
 /// <param name="lastModifyAt">LastModifyAt 属性的初始值。</param>
 /// <param name="lastModifyBy">LastModifyBy 属性的初始值。</param>
 /// <param name="jobType">JobType 属性的初始值。</param>
 public static ShopJobAd CreateShopJobAd(global::System.Int32 id, global::System.Int32 shopId, global::System.String jobTitle, global::System.Int16 salaryMin, global::System.Int16 salaryMax, global::System.String contactPhone, global::System.String description, global::System.DateTime publishedAt, global::System.DateTime dateDue, global::System.Int32 publishedBy, global::System.Int16 orderIndex, global::System.DateTime lastModifyAt, global::System.Int32 lastModifyBy, global::System.String jobType)
 {
     ShopJobAd shopJobAd = new ShopJobAd();
     shopJobAd.Id = id;
     shopJobAd.ShopId = shopId;
     shopJobAd.JobTitle = jobTitle;
     shopJobAd.SalaryMin = salaryMin;
     shopJobAd.SalaryMax = salaryMax;
     shopJobAd.ContactPhone = contactPhone;
     shopJobAd.Description = description;
     shopJobAd.PublishedAt = publishedAt;
     shopJobAd.DateDue = dateDue;
     shopJobAd.PublishedBy = publishedBy;
     shopJobAd.OrderIndex = orderIndex;
     shopJobAd.LastModifyAt = lastModifyAt;
     shopJobAd.LastModifyBy = lastModifyBy;
     shopJobAd.JobType = jobType;
     return shopJobAd;
 }