コード例 #1
0
        public ActionResult Add(int id, int ProjectOrMinorWork, string PMWEnquiryReceivedDate, int? DirectorateID,
            int? PMWContact, int? AuthorisedByName,
            string PMWDescription, FormCollection collection)
        {
            try
            {
                // TODO: Add insert logic here
                var pmw = new ProjectMinorWork();
                pmw.PremiseID = id;
                pmw.PMWDescription = PMWDescription;
                pmw.ProjectOrMinorWork = ProjectOrMinorWork;
                pmw.PMWContact = PMWContact;
                pmw.AuthorisedByName = AuthorisedByName;
                if (collection["PMWIsTBA"] == "1")
                {
                    pmw.PMWIsTBA = 1;
                }
                else
                {
                    pmw.PMWIsTBA = 0;
                    pmw.NotesActions = collection["NotesActions"];
                    pmw.EstimatedCost = collection["EstimatedCost"];
                }
                pmw.PMWStatus = collection["PMWStatus"];
                pmw.PMWEnquiryReceivedDate =(DateTime)_db.ConvertDate(PMWEnquiryReceivedDate,"dd/MM/yyyy");
                pmw.AuthorisedDate = _db.ConvertDate(collection["AuthorisedDate"], "dd/MM/yyyy");
                pmw.ActualStartDate = _db.ConvertDate(collection["ActualStartDate"], "dd/MM/yyyy");
                pmw.AnticipatedCompletion = _db.ConvertDate(collection["AnticipatedCompletion"], "dd/MM/yyyy");
                pmw.ActualCompletionDate = _db.ConvertDate(collection["ActualCompletionDate"], "dd/MM/yyyy");
                pmw.ActualCost = collection["ActualCost"];
                pmw.Directorate = DirectorateID;
                pmw.PMWIsActive = 1;
                _db.Insert(pmw);

                ViewBag.Alert = "true";
                ViewBag.Message = "Action success!";
                ViewBag.URL = "/Premise/Amend/" + id + "#tabs-7";

                return View("../Shared/Redirect");
            }
            catch
            {
                return View("../Shared/Error");
            }
        }
コード例 #2
0
 //insert
 public void Insert(ProjectMinorWork pmw)
 {
     _db.ProjectMinorWorks.InsertOnSubmit(pmw);
     _db.SubmitChanges();
 }
コード例 #3
0
 partial void UpdateProjectMinorWork(ProjectMinorWork instance);
コード例 #4
0
 partial void DeleteProjectMinorWork(ProjectMinorWork instance);
コード例 #5
0
 partial void InsertProjectMinorWork(ProjectMinorWork instance);
コード例 #6
0
		private void detach_ProjectMinorWorks1(ProjectMinorWork entity)
		{
			this.SendPropertyChanging();
			entity.Contact1 = null;
		}
コード例 #7
0
		private void attach_ProjectMinorWorks(ProjectMinorWork entity)
		{
			this.SendPropertyChanging();
			entity.Contact = this;
		}
コード例 #8
0
		private void detach_ProjectMinorWorks(ProjectMinorWork entity)
		{
			this.SendPropertyChanging();
			entity.Premise = null;
		}
コード例 #9
0
		private void detach_ProjectMinorWorks(ProjectMinorWork entity)
		{
			this.SendPropertyChanging();
			entity.Directorate1 = null;
		}