Ejemplo n.º 1
0
 public FormSettings()
 {
     InitializeComponent();
     _parameters    = new DynamicParams();
     Port.Text      = _parameters.Get().Port.ToString();
     IpAddress.Text = _parameters.Get().Ip;
 }
        protected void btnMultiUpdate_Click(object sender, EventArgs e)
        {
            var country = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlCountry")).SelectedItem.Value;

            if (country == StaticStrings.DDLDefault)
            {
                return;
            }

            var location        = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlLocation Group")).SelectedItem.Value;
            var locationGroupID = (location == StaticStrings.DDLDefault) ? -1 : Convert.ToInt32(location);

            var carClass   = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlCar Class")).SelectedItem.Value;
            var carClassID = (carClass == StaticStrings.DDLDefault) ? -1 : Convert.ToInt32(carClass);


            var utilizationValue = (txtUtilisation.Text.Length == 0) ? -1 : Convert.ToDouble(txtUtilisation.Text);
            var nonRevValue      = (txtNonRev.Text.Length == 0) ? -1 : Convert.ToDouble(txtNonRev.Text);

            if (utilizationValue == -1 && nonRevValue == -1)
            {
                return;
            }

            bllManagement.NecessaryFleetMultipleUpdate(country, locationGroupID, carClassID, utilizationValue, nonRevValue);

            ReloadGridView();
        }
        protected void btnExport_Click(object sender, EventArgs e)
        {
            var country = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlCountry")).SelectedItem.Value;

            if (country != countryDummy)
            {
                var bll = new BLLExcelExport();

                Session["ExportData"]     = bll.GetNecessaryFleetExport(country);
                Session["ExportFileName"] = "NecessaryFleet_" + country + "_";

                //Response.Redirect("../ExcelGenerator.aspx?country=" + country + "&reportType=9");
            }
        }
Ejemplo n.º 4
0
        void specify_id_conversions_exit_if_the_value_is_already_converted()
        {
            stream = new MemoryStream();

            var streamWriter = new StreamWriter(stream);

            streamWriter.Write("{ Id: 1 }");

            streamWriter.Flush();

            dynamicParams = new DynamicParams(stream, null);

            asDynamic = dynamicParams;

            ((long)asDynamic.Id).should_be(1);
        }
Ejemplo n.º 5
0
        void specify_id_conversions_exit_if_the_value_is_already_converted()
        {
            stream = new MemoryStream();

            var streamWriter = new StreamWriter(stream);

            streamWriter.Write("{ Id: 1 }");

            streamWriter.Flush();

            dynamicParams = new DynamicParams(stream, null);

            asDynamic = dynamicParams;

            ((long)asDynamic.Id).should_be(1);
        }
        private void ReloadGridView()
        {
            List <NecessaryFleet> necessaryFleetList = new List <NecessaryFleet>();

            var country       = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlCountry")).SelectedItem.Value;
            var locationGroup = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlLocation Group")).SelectedItem.Value;
            var carClass      = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlCar Class")).SelectedItem.Value;

            if (country != StaticStrings.CountryDummy)
            {
                necessaryFleetList = bllManagement.GetNecessaryFleetByCountryID(country);
                if (necessaryFleetList.Count == 0)
                {
                    grdNecessaryFleet.EmptyDataText = @"No Data available for selected country";
                }

                if (locationGroup != StaticStrings.DDLDefault)
                {
                    necessaryFleetList = necessaryFleetList.Where(p => p.LocationGroup.LocationGroupID ==
                                                                  Convert.ToInt32(locationGroup)).ToList();
                }

                if (carClass != StaticStrings.DDLDefault)
                {
                    necessaryFleetList = necessaryFleetList.Where(p => p.CarGroup.CarGroupID ==
                                                                  Convert.ToInt32(carClass)).ToList();
                }

                Session["NecessaryFleet"] = necessaryFleetList;
            }
            else
            {
                grdNecessaryFleet.EmptyDataText = @"Please select a country";
            }

            grdNecessaryFleet.DataSource = necessaryFleetList;
            grdNecessaryFleet.DataBind();
        }
Ejemplo n.º 7
0
 public TestConnection()
 {
     _parameters = new DynamicParams();
 }
Ejemplo n.º 8
0
 public DriveState next_state(DynamicParams dp)
 {
     return(DriveState.on_road);
 }
Ejemplo n.º 9
0
        void act_each()
        {
            dynamicParams = new DynamicParams(nameValueCollection, null);

            asDynamic = dynamicParams;
        }
Ejemplo n.º 10
0
 public UpdateTests()
 {
     _parameters = new DynamicParams();
 }
Ejemplo n.º 11
0
 // Start is called before the first frame update
 void Start()
 {
     state     = DriveState.on_road;
     drive_ssm = new DrivingSSM(this);
     env       = new DynamicParams();
 }
        private void PopulateDropDowns()
        {
            Country dummy = new Country();

            dummy.CountryDescription = StaticStrings.SelectCountry;
            dummy.CountryID          = StaticStrings.CountryDummy;

            List <Country> countries = bllManagement.CountryGetAllByRole(this.Page.RadUserId());

            System.Web.UI.WebControls.DropDownList ddlCountryList = ((System.Web.UI.WebControls.DropDownList)DynamicParams.FindControl("ddlCountry"));

            ddlCountryList.DataTextField       = "CountryDescription";
            ddlCountryList.DataValueField      = "CountryID";
            ddlCountryListReset.DataTextField  = "CountryDescription";
            ddlCountryListReset.DataValueField = "CountryID";

            countries.Insert(0, dummy);

            ddlCountryList.DataSource = countries;
            ddlCountryList.DataBind();

            ddlCountryListReset.DataSource = countries;
            ddlCountryListReset.DataBind();

            if (countries.Count == 2)
            {
                ddlCountryList.SelectedIndex      = 1;
                ddlCountryListReset.SelectedIndex = 1;
            }

            ddlResetType.Items.Add(new ListItem("Utilisation", "1"));
            ddlResetType.Items.Add(new ListItem("Non/Rev", "2"));
        }
        void act_each()
        {
            dynamicParams = new DynamicParams(nameValueCollection, null);

            asDynamic = dynamicParams;
        }
Ejemplo n.º 14
0
 public ResultSender()
 {
     _parameters = new DynamicParams();
 }