Ejemplo n.º 1
0
 public ActionResult Addnewschedule(Windowservice service)
 {
     using (DSRCManagementSystemEntities1 db = new DSRCManagementSystemEntities1())
     {
         //Windowservice windows = new Windowservice();
         //windows.ServiceName = service.ServiceName;
         //windows.ServiceType = service.ServiceType;
         //windows.StartDate = service.StartDate;
         //windows.EndDate = service.EndDate;
         //windows.MailTO = service.MailTO;
         //db.Windowservicecontrols.AddObject(windows);
         //db.SaveChanges();
     }
     return(View());
 }
Ejemplo n.º 2
0
        public ActionResult Addnewschedule()
        {
            DSRCManagementSystemEntities1 objdb = new DSRCManagementSystemEntities1();

            try
            {
                Windowservice model = new Windowservice();
                model.StartDate = DateTime.Today.ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
                model.EndDate   = DateTime.Today.AddYears(5).ToString("dd/MM/yyyy", CultureInfo.InvariantCulture);
                var Mails = (from t in objdb.Users.Where(x => x.IsActive == true)
                             select new
                {
                    Id = t.UserID,
                    UserName = t.UserName,
                }).ToList();

                var schedules = (from p in objdb.Master_WindowServiceSchedules
                                 select new
                {
                    ScheduleId = p.Id,
                    ScheduleName = p.Schedules
                }).ToList();
                var services = (from p in objdb.Master_Windowsservices
                                select new
                {
                    Id = p.Id,
                    Services = p.WindowServices
                }).ToList();

                ViewBag.MailTO    = new MultiSelectList(Mails, "Id", "UserName");
                ViewBag.Schedules = new SelectList(new List <string> {
                    "Daily", "Weekly", "Monthly", "Instant"
                });
                ViewBag.services = new SelectList(services, "Id", "Services");
            }
            catch (Exception Ex)
            {
                string actionName     = this.ControllerContext.RouteData.Values["action"].ToString();
                string controllerName = this.ControllerContext.RouteData.Values["controller"].ToString();
                ExceptionHandlingController.ExceptionDetails(Ex, actionName, controllerName);
            }
            return(View());
        }