public ActionResult AddScheduleTest(FormCollection colection, ScheduleTest ScheduleTest) { int? DeviceId = colection["DeviceId"].Equals("") ? (int?)null : Convert.ToInt32(colection["DeviceId"]); DateTime?DateOfTest = colection["DateOfTest"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["DateOfTest"]); DateTime?NextDateOfTest = colection["NextDateOfTest"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["NextDateOfTest"]); String CategoryTest = colection["CategoryTest"]; int? UserTest = colection["UserTest"].Equals("0") ? (int?)null : Convert.ToInt32(colection["UserTest"]); String Notes = colection["Notes"]; Ql.AddScheduleTest(DeviceId, DateOfTest, NextDateOfTest, CategoryTest, UserTest, Notes); return(RedirectToAction("ScheduleTest", "ScheduleTest")); }
public ActionResult EditScheduleTest(FormCollection colection, ScheduleTest ScheduleTest) { int?Id = colection["Id"].Equals("") ? (int?)null : Convert.ToInt32(colection["Id"]); int?DeviceId = colection["DeviceId"].Equals("") ? (int?)null : Convert.ToInt32(colection["DeviceId"]); //var dateot = colection["DateOfTest"]; DateTime?DateOfTest = colection["DateOfTest"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["DateOfTest"]); DateTime?NextDateOfTest = colection["NextDateOfTest"].Equals("") ? (DateTime?)null : Convert.ToDateTime(colection["NextDateOfTest"]); String CategoryTest = colection["CategoryTest"]; int? UserTest = colection["UserTest"].Equals("0") ? (int?)null : Convert.ToInt32(colection["UserTest"]); String Notes = colection["Notes"]; int? Status = colection["Status"].Equals("") ? (int?)null : Convert.ToInt32(colection["Status"]); Ql.UpdateScheduleTest(Id, DeviceId, DateOfTest, NextDateOfTest, CategoryTest, UserTest, Notes, Status); return(RedirectToAction("EditScheduleTest", "ScheduleTest")); }