public ActionResult Event() { SSPStaffService ssp = new SSPStaffService(); IEnumerable <SSPStaff> SSP = ssp.GetSSPStaffList(); ViewData["SSP"] = SSP; EventTypeService ets = new EventTypeService(); IEnumerable <EventType> etl = ets.GetEventTypeList(); ViewData["ETL"] = etl; //IEnumerable<ProposalStatusList> ProposalStatus = ServiceDDL.GetProposalStatusList(); //ViewData["ProposalStatus"] = ProposalStatus; return(View()); }
public ActionResult Index() { try { EventTypeService _typeService = new EventTypeService(); ViewBag.type = _typeService.GetAll(UserID); return(View()); } catch (ServiceException serviceEx) { throw serviceEx; } catch (DataAccessException accessEx) { throw accessEx; } catch (Exception ex) { throw new ControllerException(FILE_NAME, "Index", UserID, ex); } }
protected DispatcherContext(string configDbConnectionString = null) { _dbContext = new DatabasesContext { IsInternalDispatcherContext = true, ConfigDbConnectionString = configDbConnectionString }; EventService = new EventService(this); EventTypeService = new EventTypeService(this); BulbService = new BulbService(this); ComponentTypeService = new ComponentTypeService(this); LogService = new LogService(this); MetricService = new MetricService(this); UnitTestTypeService = new UnitTestTypeService(this); UnitTestService = new UnitTestService(this); SubscriptionService = new SubscriptionService(DbContext); PaymentService = ConfigDbServicesHelper.GetPaymentService(DbContext); ComponentService = new ComponentService(this); UserService = new UserService(DbContext); AccountService = ConfigDbServicesHelper.GetAccountService(); AccountManagementService = ConfigDbServicesHelper.GetAccountManagementService(this); DatabaseService = ConfigDbServicesHelper.GetDatabaseService(); }
public EventTypesController(EventTypeService eventTypeService) { this.eventTypeService = eventTypeService; }
public EditModel(IssWebRazorApp.Data.IssWebRazorAppContext context) { _context = context; EventTypeList = EventTypeService.GetSelectList(); }
/* * private bool DeleteMyFile(int FileID, int EventID) * { * bool result = true; * ProjectEventService pes = new ProjectEventService(); * string dir = ConfigurationManager.AppSettings["PhysicalPath"]; * string virpath = pes.GetProjectEventDocument(FileID).PhysicalVirtualPath; * System.IO.File.Delete(dir + virpath); * pes.DeleteDocument(FileID, EventID); * return result; * } * */ // // GET: /Event/ public ActionResult Index(int?id) { if (Session["ProposalID"] == null) { return(RedirectToAction("Search", "ProposalInfo")); } EventTypeService et = new EventTypeService(); ProjectEventService pes = new ProjectEventService(); SSPStaffService sss = new SSPStaffService(); ViewData["ddlEventType"] = new SelectList(et.GetEventTypeList(), "EventTypeID", "EventTypeName", 31); //Session["ProposalID"] = "1"; int ProposalID = Session["ProposalID"] != null?int.Parse(Session["ProposalID"].ToString()) : 0; ViewData["ProjectID"] = ProposalID; IEnumerable <ProjectEvent> pe = pes.GetProjectEventList(ProposalID); IEnumerable <SSPStaff> slist = sss.GetSSPStaffListForProject(ProposalID); List <SelectListItem> selects = new List <SelectListItem>(); if (slist != null) { //this gets users who is in keyassosiactions. foreach (var item in slist) { selects.Add(new SelectListItem() { Value = item.SSPStaffID.ToString(), Text = item.FirstName + " " + item.LastName + " " + item.MiddleName }); } //-----------------This chunk added in order not // =========to lose previous eventHolder. //next step we must add users who is participating in this project if they don't exist, //this will cover users who was deleted from keyassociations, but did particular event. //How to do that? we go through all Events, get event Holders and compare HolderID agains slist. if does not exist we add. foreach (ProjectEvent e in pe) { //check if staff in event inside DropDown. SelectListItem sitem = (from x in selects where x.Value.ToString() == e.EventHolderID.ToString() select x).FirstOrDefault(); if (sitem == null) //no staff. { SSPStaff staff = null; //get that user from repository if (e.EventHolderID.HasValue) { staff = sss.GetAccountByID(e.EventHolderID.Value); } //insert. if (staff != null) { selects.Add(new SelectListItem() { Value = staff.SSPStaffID.ToString(), Text = staff.FirstName + " " + staff.LastName + " " + staff.MiddleName }); } } } //---------------------- } ViewData["SSPStaffList"] = selects; ProjectService projservice = new ProjectService();; Project _project; _project = projservice.GetProposalInfo(ProposalID); List <SelectListItem> reportperiods = new List <SelectListItem>(); try { foreach (var item in _project.Budget.ReportPeriodListRs) { reportperiods.Add(new SelectListItem() { Value = item.ReportPeriodID.ToString(), Text = (item.PeriodStart.HasValue ? item.PeriodStart.Value.ToShortDateString() : "") + " - " + (item.PeriodEnd.HasValue ? item.PeriodEnd.Value.ToShortDateString() : "") }); } } catch (Exception ex) {} ViewData["ReportPeriodList"] = reportperiods; if (id.HasValue == true) { ViewData["selectedID"] = id; } return(View(pe)); }
public EventTypeServiceUnitTests() { _target = new EventTypeService(); }
public EventTypeService getEventTypeService() { if (eventTypeService == null) { eventTypeService = new EventTypeServiceImpl(); } return eventTypeService; }
public EventTypeController(EMSContext context) { _context = context; _service = new EventTypeService(_context); }