Пример #1
0
 public ActionResult Create(Election Model)
 {
     ViewData["ElectionTypes"] = Globals.GetElectionTypes();
     if (Model != null)
     {
         if (!string.IsNullOrEmpty(Model.Name))
         {
             if (!m_merkezDC.Elections.Any(x => x.Name == Model.Name))
             {
                 Model.CreatedAt = DateTime.Now;
                 Model.CreatedBy = User.Identity.Name;
                 m_merkezDC.Elections.InsertOnSubmit(Model);
                 m_merkezDC.SubmitChanges();
                 for (int i = 1; i < 5; i++)
                 {
                     var process = new ElectionDetail();
                     process.StartDate = Convert.ToDateTime(Request.Form["StartDate"]);
                     process.FinishDate = Convert.ToDateTime(Request.Form["FinishDate"]);
                     process.ElectionId = Model.ElectionId;
                     process.StatusId = i;
                     process.StartedBy = User.Identity.Name;
                     process.FinishedBy = User.Identity.Name;
                     process.ActionDate = DateTime.Now;
                     m_merkezDC.ElectionDetails.InsertOnSubmit(process);
                 }
                 m_merkezDC.SubmitChanges();
                 ViewData["Message"] = "Seçim Başarıyla Eklendi Süreçlerinin Yönetmek İçin Lütfen Aşağıdaki Ekranı Kullanınız.";
                 return RedirectToAction("ManageElectionProcess", new { Model.ElectionId });
             }
             else
             {
                 ViewData["Message"] = "Aynı İsimle Yalnızca Bir Adet Seçim Eklenebilir.";
             }
         }
     }
     return View();
 }
Пример #2
0
 partial void DeleteElection(Election instance);
Пример #3
0
 partial void UpdateElection(Election instance);
Пример #4
0
 partial void InsertElection(Election instance);
Пример #5
0
		private void detach_Elections(Election entity)
		{
			this.SendPropertyChanging();
			entity.ElectionType = null;
		}
Пример #6
0
		private void attach_Elections(Election entity)
		{
			this.SendPropertyChanging();
			entity.ElectionType = this;
		}