/// <summary>
 /// Create a new WantJob object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="subjectsID">Initial value of the SubjectsID property.</param>
 /// <param name="workerID">Initial value of the WorkerID property.</param>
 public static WantJob CreateWantJob(global::System.String id, global::System.Int32 subjectsID, global::System.String workerID)
 {
     WantJob wantJob = new WantJob();
     wantJob.ID = id;
     wantJob.SubjectsID = subjectsID;
     wantJob.WorkerID = workerID;
     return wantJob;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the WantJob EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToWantJob(WantJob wantJob)
 {
     base.AddObject("WantJob", wantJob);
 }
        public ActionResult WantJob(WantJobList JobList, FormCollection FormPost)
        {
            var User = (DAL.UserInfo)Session["NewUser"];
            string SelectStr = FormPost["subject-select"];

            if (SelectStr != "")
            {
                try
                {
                    string[] SelectResult = SelectStr.Substring(0, SelectStr.Length - 1).Split(',');
                    string NewWorkerId = User.UserID;

                    for (int i = 0; i < SelectResult.Count(); i++)
                    {
                        DAL.WantJob WorkerWant = new WantJob();
                        WorkerWant.ID = BLL.BaseUtility.GenerateGUID();
                        WorkerWant.SubjectsID = Convert.ToInt32(SelectResult[i]);
                        WorkerWant.WorkerID = NewWorkerId;

                        DbEntities.WantJob.AddObject(WorkerWant);
                        DbEntities.SaveChanges();
                    }

                    return RedirectToAction("VerifyEmail", "Account");
                }
                catch
                {
                    ModelState.AddModelError("", "failed, please try again.");
                    return View(JobList);
                }
            }
            else
            {
                return RedirectToAction("VerifyEmail", "Account");
            }
        }