Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.employeeTollId            = Common.GetEncryptedQueryStringValue("employeeTollId", 0);
            this.employeeId                = Common.GetEncryptedQueryStringValue("employeeId", 0);
            this.vehicleId                 = Common.GetEncryptedQueryStringValue("vehicleId", 0);
            ViewState["employeeVehicleId"] = Common.GetEncryptedQueryStringValue("employeeVehicleId", 0);

            LabelPageTitle.Text = String.Format("{0} {1}", "Employee Toll", Employee.GetEmployeeByEmployeeId(this.employeeId).FormattedNameNumber);

            PanelError.Visible = false;

            Page.Form.DefaultFocus  = DropDownListVehicle.ClientID;
            Page.Form.DefaultButton = ButtonSave.UniqueID;

            if (this.employeeId != 0)
            {
                BindGridviewResult();
            }

            if (!IsPostBack)
            {
                DropDownListVehicle.Focus();
                BindPaymentType();

                BindVehicle();
                //ViewState["employeeTollId"] = employeeTollId;

                if (this.employeeTollId != 0)
                {
                    BindEmployeeToll();
                }

                if (this.vehicleId != 0)
                {
                    DropDownListVehicle.Items.FindByValue(this.vehicleId.ToString()).Selected = true;
                }

                if (ViewState["employeeId"] != null)
                {
                    this.employeeId = Convert.ToInt32(ViewState["employeeId"].ToString());
                }
            }
        }