public ActionResult Source_edit(long Id) { ViewBag.messagealert = string.Empty; Sourcee = new ETSource(); Sourcee = repSource.GetSource(Id); ViewBag.SourceTypes = repSource.getDataValues("SourceType", Session["UserLevel"].ToString(), Convert.ToInt64(Session["UserID"]), Convert.ToInt64(Session["ReportingUser"])); return(View(Sourcee)); }
public void TestGetSourceShouldReturnCsvFileSource() { var source = new CsvFileSource(); _sources.Add(source.GetType(), source); var result = _repository.GetSource <CsvFileSource>(); Assert.That(result, Is.EqualTo(source)); }
protected void Page_Load(object sender, EventArgs e) { //if (!Context.User.IsInRole("Operation Manager")) //{ // Response.Redirect("NotAuthorized.aspx"); //} if (!IsPostBack) { TemplatesRepository Tr = new TemplatesRepository(); Tr.UpdateStatus(); } SourceRepository Sr = new SourceRepository(); List <Source> L = Sr.GetSource(); EventRepository ER = new EventRepository(); TemplateEventRepository TE = new TemplateEventRepository(); foreach (Source s in L) { Label SourceName = new Label(); SourceName.Text = s.SourceName.ToString(); PlaceHolder PR1 = new PlaceHolder(); List <Events> Event = ER.GetEventsid(s.SourceId); foreach (Events OneEvent in Event) { Table T = new Table(); TableRow tablerow = new TableRow(); TableCell tableCell = new TableCell(); Label LE = new Label(); LE.Text = OneEvent.EventName; PlaceHolder Pr2 = new PlaceHolder(); List <TemplateEvent> TemplateEvent = TE.GetTemplatesid(OneEvent.EventId); foreach (TemplateEvent OneTemplate in TemplateEvent) { Label LT = new Label(); LT.Text = OneTemplate.TemplateName; HyperLink DeleteTemplate = new HyperLink(); HyperLink ConfigureTemplate = new HyperLink(); DeleteTemplate.Text = "Delete"; ConfigureTemplate.Text = "Configure"; DeleteTemplate.NavigateUrl = "TemplateDelete.aspx?id=" + OneTemplate.TemplateId; Pr2.Controls.Add(LT); Pr2.Controls.Add(new LiteralControl(" ")); Pr2.Controls.Add(DeleteTemplate); Pr2.Controls.Add(ConfigureTemplate); Pr2.Controls.Add(new LiteralControl("<br/>")); tableCell.Controls.Add(Pr2); } tablerow.Cells.Add(tableCell); T.Rows.Add(tablerow); PR1.Controls.Add(LE); PR1.Controls.Add(new LiteralControl(" ")); PR1.Controls.Add(T); PR1.Controls.Add(new LiteralControl("<br/>")); } PlaceHolder1.Controls.Add(SourceName); PlaceHolder1.Controls.Add(new LiteralControl(" ")); PlaceHolder1.Controls.Add(new LiteralControl("<br/>")); PlaceHolder1.Controls.Add(PR1); PlaceHolder1.Controls.Add(new LiteralControl("<br/>")); } }
protected void Page_Load(object sender, EventArgs e) { //if (!Context.User.IsInRole("OperationManager")) //{ // Response.Redirect("NotAuthorized.aspx"); //} SourceRepository Sr = new SourceRepository(); List <Source> L = Sr.GetSource(); EventRepository ER = new EventRepository(); TemplateEventRepository TE = new TemplateEventRepository(); foreach (Source s in L) { Label SourceName = new Label(); SourceName.Text = s.SourceName.ToString(); PlaceHolder PR1 = new PlaceHolder(); List <Events> Event = ER.GetEventsid(s.SourceId); foreach (Events OneEvent in Event) { Table Tables = new Table(); TableRow Rows = new TableRow(); TableCell Cells = new TableCell(); Label EventName = new Label(); EventName.Text = OneEvent.EventName; Label LTSpace1 = new Label(); LTSpace1.Text = ""; LTSpace1.Width = 65; PlaceHolder PR2 = new PlaceHolder(); List <TemplateEvent> TemplateEvent = TE.GetTemplatesid(OneEvent.EventId); foreach (TemplateEvent OneTemplate in TemplateEvent) { Label LTSpace2 = new Label(); LTSpace2.Text = ""; LTSpace2.Width = 115; Label TemplateName = new Label(); TemplateName.Text = OneTemplate.TemplateName; HyperLink ConfigureTemplate = new HyperLink(); HyperLink DeleteTemplate = new HyperLink(); LiteralControl LTSpace3 = new LiteralControl(); LTSpace3.Text = " "; LiteralControl LTSpace4 = new LiteralControl(); LTSpace4.Text = " "; ConfigureTemplate.Text = "Configure"; DeleteTemplate.Text = "Delete"; DeleteTemplate.NavigateUrl = "TemplateDelete.aspx?id=" + OneTemplate.TemplateId; PR2.Controls.Add(LTSpace2); PR2.Controls.Add(TemplateName); PR2.Controls.Add(LTSpace4); PR2.Controls.Add(ConfigureTemplate); PR2.Controls.Add(LTSpace3); PR2.Controls.Add(DeleteTemplate); Cells.Controls.Add(PR2); } Rows.Cells.Add(Cells); Tables.Rows.Add(Rows); PR1.Controls.Add(LTSpace1); PR1.Controls.Add(EventName); PR1.Controls.Add(Tables); } PlaceHolder1.Controls.Add(SourceName); PlaceHolder1.Controls.Add(new LiteralControl("<br/>")); PlaceHolder1.Controls.Add(PR1); } }