protected void btnSrch_Click(object sender, EventArgs e)
 {
     try
     {
         if (!String.IsNullOrWhiteSpace(txtSea.Value))
         {
             string srch = txtSea.Value; usr = (User)Session["user"];
             gvVehicle.DataSource = VehicleBLL.GetVehicleList(usr.LocationID.Value).Where(v => v.PlateNo.ToUpper().Trim() == srch.ToUpper().Trim()).ToList();
             gvVehicle.DataBind();
         }
     }
     catch
     {
     }
 }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            User usr = null;

            if (!IsPostBack)
            {
                if (Session["user"] != null)
                {
                    usr = (User)Session["user"];
                }
                else
                {
                    Response.Redirect("../Login.aspx", false);
                    return;
                }
                int totalPendAppr = 0; int totalPendAss = 0; int totalCmpRequest = 0; int totalVehPool = 0; int totalvehEnt = 0;
                totalPendAppr   = TripBLL.GetTripListByAdmin(usr.LocationID.Value).Where(t => t.Status == (int)Utility.FleetRequestStatus.Pending_FleetManager_Approval).Count();
                totalPendAss    = TripBLL.GetTripListByAdmin(usr.LocationID.Value).Where(t => t.Status == (int)Utility.FleetRequestStatus.Pending_Vehicle_Assignment).Count();
                totalCmpRequest = TripBLL.GetTripListByAdmin(usr.LocationID.Value).Where(t => t.Status == (int)Utility.FleetRequestStatus.Completed).Count();
                totalVehPool    = VehicleBLL.GetVehicleList(usr.LocationID.Value).Where(t => t.Status == (int)Utility.VehicleStatus.Available).Count();
                totalvehEnt     = VehicleBLL.GetVehicleList(usr.LocationID.Value).Where(t => t.Status == (int)Utility.VehicleStatus.Enroute).Count();
                //lnkPendAppr.Text = "Total Number of Requests pending Approval ("+totalPendAppr.ToString()+")";
                //lnkPendAppr.NavigateUrl = "ManageFleetRequest.aspx?stat=" + ((int)Utility.FleetRequestStatus.Pending_FleetManager_Approval).ToString();
                lnkPendAppr1.InnerHtml = "Total Number of Requests pending Approval<b> (" + totalPendAppr.ToString() + ")</b>";
                lnkPendAppr1.HRef      = "ManageFleetRequest.aspx?stat=" + ((int)Utility.FleetRequestStatus.Pending_FleetManager_Approval).ToString();

                lnkpendAss.InnerHtml = "Total Number of Requests pending Vehicle Assignment <b>(" + totalPendAss.ToString() + ")</b>";
                lnkpendAss.HRef      = "ManageFleetRequest.aspx?stat=" + ((int)Utility.FleetRequestStatus.Pending_Vehicle_Assignment).ToString();

                lnkCmpReq.InnerHtml = "Total Number of Completed Request (<b>" + totalCmpRequest.ToString() + ")</b>";
                lnkCmpReq.HRef      = "ManageFleetRequest.aspx?stat=" + ((int)Utility.FleetRequestStatus.Completed).ToString();

                lnkVehPool.InnerHtml = "Total Number of Vehicles Available in the Pool <b>(" + totalVehPool + ")</b>";
                lnkVehPool.HRef      = "ManageVehicle.aspx?stat=" + ((int)Utility.VehicleStatus.Available).ToString();

                lnkvehEnt.InnerHtml = "Total Number of Vehicles Enroute <b>(" + totalvehEnt + ")</b>";
                lnkvehEnt.HRef      = "ManageVehicle.aspx?stat=" + ((int)Utility.VehicleStatus.Enroute).ToString();
            }
        }
 protected void OnSelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         usr = (User)Session["user"];
         if (optVehicle.SelectedValue == "1")
         {
             gvVehicle.DataSource = VehicleBLL.GetVehicleList(usr.LocationID.Value).Where(p => p.Status == (int)Utility.VehicleStatus.Available).ToList();
             gvVehicle.DataBind();
             mpeAssign.Show();
         }
         if (optVehicle.SelectedValue == "2")
         {
             gvVehicle.DataSource = VehicleBLL.GetVehicleList(usr.LocationID.Value).Where(p => p.Status == (int)Utility.VehicleStatus.Enroute).ToList();
             gvVehicle.DataBind();
             mpeAssign.Show();
         }
     }
     catch (Exception ex)
     {
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (Session["user"] != null)
         {
             usr = (User)Session["user"];
         }
         else
         {
             Response.Redirect("../Login.aspx", false);
             return;
         }
         if (!IsPostBack)
         {
             BindGrid();
             BindDrivers();
             BindInsuranceCoy();
             BindTrackerCoy();
             BindVehicleMaker();
             BindVehicleType();
             BindLocation();
             if (Request.QueryString["stat"] != null)
             {
                 int sta = int.Parse(Request.QueryString["stat"].ToString());
                 gvVehicle.DataSource = VehicleBLL.GetVehicleList(usr.LocationID.Value).Where(v => v.Status == sta).ToList();
                 gvVehicle.DataBind();
             }
         }
     }
     catch (Exception ex)
     {
         error.Visible   = true;
         error.InnerHtml = "<button type='button' class='close' data-dismiss='alert'>&times;</button> An error occurred. kindly try again!!!";
         Utility.WriteError("Error: " + ex.Message);
     }
 }
 private void BindGrid()
 {
     usr = (User)Session["user"];
     gvVehicle.DataSource = VehicleBLL.GetVehicleList(usr.LocationID.Value);
     gvVehicle.DataBind();
 }
 // GET: Admin/VehicleList
 public ActionResult Index()
 {
     SetActiveMenuItem();
     return(View(model: VehicleBLL.GetVehicleList()));
 }
 private void BindGrid(int id)
 {
     usr = (User)Session["user"];
     gvheader.DataSource = VehicleBLL.GetVehicleList(usr.LocationID.Value, id);
     gvheader.DataBind();
 }
 private void BindVehicleGrid()
 {
     usr = (User)Session["user"];
     gvVehicle.DataSource = VehicleBLL.GetVehicleList(usr.LocationID.Value).Where(p => p.Status == (int)Utility.VehicleStatus.Available).ToList();
     gvVehicle.DataBind();
 }