public Gate( string name, TollStation tollStation, IEnumerable <GateAccessType> gateAccessType, IEnumerable <GatePaymentOption> paymentOptions, string publicId) { this.GateAccessTypes = gateAccessType == null ? new List <GateAccessType>() : gateAccessType.ToList(); this.Name = name; this.TollStation = tollStation; this.PublicId = publicId; this.PaymentOptions = paymentOptions == null ? new List <GatePaymentOption>() : paymentOptions.ToList(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string strTID = Request.QueryString["tid"].ToString(); TollStation station = (TollStation)Session["stationinfo"]; DataTable dtType = DBHelper.GetDataSet("select * from S_NewsType where T_ID='" + strTID + "'"); this.Title = dtType.Rows[0]["T_Name"].ToString() + "-" + station.TS_Name + "门户网站"; lblTypeName.Text = dtType.Rows[0]["T_Name"].ToString(); ViewState["tid"] = strTID; binddata(); } }
private void CreateTollStations() { var tollStationWroclawWschod = new TollStation( "Wrocław Wschód", new Address("Wiejska 1", "Kobierzyce", "51-124", "Polska", "11,12", "51,14"), "wro-w" ); this.wroclawWschodGates = new List <Gate> { new Gate("Gate-1", tollStationWroclawWschod, new [] { GateAccessType.Ticket, GateAccessType.ViaToll }, null, "wro-w-g1"), new Gate("Gate-2", tollStationWroclawWschod, new [] { GateAccessType.Ticket, GateAccessType.ViaToll }, null, "wro-w-g2") }; tollStationWroclawWschod.AddGates(wroclawWschodGates); var tollStationWroclawPoludnie = new TollStation( "Wrocław Południe", new Address("Miejska 1", "Wrocław", "55-124", "Polska", "12,87", "51,32"), "wro-p" ); this.wroclawPoludnieGates = new List <Gate> { new Gate("Gate-1", tollStationWroclawPoludnie, new [] { GateAccessType.Payment }, new [] { GatePaymentOption.Card, GatePaymentOption.Cash }, "wro-p-g1"), new Gate("Gate-2", tollStationWroclawPoludnie, new [] { GateAccessType.Payment }, new [] { GatePaymentOption.Card, GatePaymentOption.Cash }, "wro-p-g2"), new Gate("Gate-3", tollStationWroclawPoludnie, new [] { GateAccessType.Payment }, new [] { GatePaymentOption.PrePaid }, "wro-p-g3"), new Gate("Gate-4", tollStationWroclawPoludnie, new [] { GateAccessType.Payment }, new [] { GatePaymentOption.PrePaid }, "wro-p-g4") }; tollStationWroclawPoludnie.AddGates(this.wroclawPoludnieGates); var tollStationKatowice = new TollStation( "Katowice Station", new Address("Górnicza 1", "Katowice", "18-124", "Polska", "14,87", "53,32"), "kat" ); this.katowiceGates = new List <Gate> { new Gate("Gate-1", tollStationKatowice, new [] { GateAccessType.Payment }, new [] { GatePaymentOption.Card, GatePaymentOption.Cash }, "kat-g1"), new Gate("Gate-2", tollStationKatowice, new [] { GateAccessType.Payment }, new [] { GatePaymentOption.PrePaid }, "kat-g2") }; tollStationKatowice.AddGates(katowiceGates); this.TollStations = new List <TollStation> { tollStationWroclawWschod, tollStationWroclawPoludnie, tollStationKatowice }; }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { CommonFunction.isLoginCheck("timeout.aspx"); bindcitydata(); bindcompanydata(); bindhighwaydata(); bindstardata(); if (Request.QueryString["tsid"] == null) { ViewState["tsid"] = ((UserInfo)Session["StationUser"]).U_TollStation.TS_ID; } else { ViewState["tsid"] = Request.QueryString["tsid"].ToString(); } TollStation station = TollStationService.Get_TollStationEntity(Convert.ToInt32(ViewState["tsid"])); txtName.Text = station.TS_Name; txtPinYin.Text = station.TS_PinYin; txtStake.Text = station.TS_Stake; txtStakeNum.Text = station.TS_StakeNum.ToString(); txtRen.Text = station.TS_Manager; txtPhone.Text = station.TS_Phone; txtHonour.Text = station.TS_Honour; txtWelcome.Text = station.TS_Welcome; ddlHighway.SelectedValue = station.TS_Highway.H_ID.ToString(); ddlUnit.SelectedValue = station.TS_Company.C_ID.ToString(); ddlCity.SelectedValue = station.TS_City.CI_ID.ToString(); ddlStar.SelectedValue = station.TS_Star; txtLaneNum.Text = station.TS_LaneNum; txtExitToRoad.Text = station.TS_ExitToRoad; txtRemark.Text = station.TS_Remark; Image1.ImageUrl = "../StationPhoto/" + station.TS_MainPhoto; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["stationid"] != null) { int StationId = Convert.ToInt32(Request.QueryString["stationid"]); TollStation station = TollStationService.Get_TollStationEntity(StationId); if (station != null) { Session["stationinfo"] = station; Response.Redirect("index.aspx"); } else { Response.Redirect("StationList.aspx"); } } else { Response.Redirect("StationList.aspx"); } } }
public void GetGateAccessTypes_WhenTollStationIsInDatabase_ThenReturnsGateAccessOptions() { // Arrange var gateAccessTypes = new List <GateAccessType> { GateAccessType.Ticket }; var gatePublicId = "wro-g1"; var tollStationPublicId = "wro-t1"; var gate = new Gate("test-gate", gateAccessTypes, new List <GatePaymentOption>(), gatePublicId); var tollStation = new TollStation("test-toll-station", new List <Gate> { gate }, null, tollStationPublicId); this.mockStubDataRepository.Setup(x => x.TollStations).Returns(new List <TollStation> { tollStation }); // Act var result = this.sut.GetGateAccessTypes(tollStationPublicId, gatePublicId); // Assert result.IsSuccess.Should().BeTrue(); result.Data.Should().BeEquivalentTo(gateAccessTypes); }
public void AssignToolStation(TollStation tollStation) { this.TollStation = tollStation; // In that case I could raise a Domain Event that a new Toll station was assigned to the gate and perform then next actions. }