Esempio n. 1
0
        public void start(SCApplication app)
        {
            vehicleBLL          = app.VehicleBLL;
            vehicleService      = app.VehicleService;
            segmentBLL          = app.SegmentBLL;
            addressesBLL        = app.AddressesBLL;
            guideBLL            = app.GuideBLL;
            cmdBLL              = app.CMDBLL;
            unitBLL             = app.UnitBLL;
            commObjCacheManager = app.getCommObjCacheManager();
            var vhs = app.getEQObjCacheManager().getAllVehicle();

            lineService = app.LineService;
            foreach (AVEHICLE vh in vhs)
            {
                vh.CommandComplete       += Vh_CommandComplete;
                vh.BatteryLevelChange    += Vh_BatteryLevelChange;
                vh.BatteryCapacityChange += Vh_BatteryCapacityChange;
            }

            //註冊各個Coupler的Status變化,在有其中一個有變化的時候要通知AGV目前所有coupler的狀態
            List <AUNIT> chargers = unitBLL.OperateCatch.loadUnits();

            foreach (AUNIT charger in chargers)
            {
                //charger.CouplerStatusChanged += Charger_CouplerStatusChanged;
                charger.CouplerHPSafetyChaged += Charger_CouplerHPSafetyChaged;
            }
        }
Esempio n. 2
0
 private void LeaveScan()
 {
     while (isLeave)
     {
         Thread.Sleep(1000);
         bitmap = videoSourcePlayer1.GetCurrentVideoFrame();
         string licemsePlateNum = LicensePlateOCR.Get(bitmap);
         if (licemsePlateNum != null)
         {
             string result;
             label1.Text = VehicleBLL.VehicleLeave(licemsePlateNum, out result) ? "欢迎离开" : "";
             label2.Text = result;
             label3.Text = AdminBLL.GetActiveParkNum() + " / " + AdminBLL.GetParkingSpotNum();
             BaseBLL.SaveALL();
             FormManage form = (FormManage)Owner;
             form.Refresh();
             Thread.Sleep(8000);
         }
         else
         {
             label1.Text = "检测失败";
             label2.Text = "";
         }
     }
     label1.Text = label2.Text = "";
 }
Esempio n. 3
0
        private void InlineEfficiencyMonitor(ALINE line)
        {
            VehicleBLL vehicleBLL = scApp.VehicleBLL;
            CMDBLL     cmdBLL     = scApp.CMDBLL;

            line.CurrntVehicleModeAutoRemoteCount = vehicleBLL.cache.getVhCurrentModeInAutoRemoteCount();
            line.CurrntVehicleModeAutoLoaclCount  = vehicleBLL.cache.getVhCurrentModeInAutoLocalCount();
            line.CurrntVehicleStatusIdelCount     = vehicleBLL.cache.getVhCurrentStatusInIdleCount();
            line.CurrntVehicleStatusErrorCount    = vehicleBLL.cache.getVhCurrentStatusInErrorCount();
            var    host_cmds = cmdBLL.loadACMD_MCSIsUnfinished();
            var    cst       = scApp.CassetteDataBLL.loadCassetteData();
            UInt16 carrier_transferring_count = (UInt16)cst.
                                                Where(x => x.CSTState == E_CSTState.Alternate ||
                                                      x.CSTState == E_CSTState.WaitIn ||
                                                      x.CSTState == E_CSTState.WaitOut ||
                                                      x.CSTState == E_CSTState.Transferring).
                                                Count();
            UInt16 carrier_watting_count = (UInt16)cst.
                                           Where(x => x.CSTState == E_CSTState.Installed ||
                                                 x.CSTState == E_CSTState.Completed).
                                           Count();

            UInt16 host_cmd_assigned_count = (UInt16)host_cmds.
                                             Where(cmd => cmd.TRANSFERSTATE >= E_TRAN_STATUS.Transferring).
                                             Count();
            UInt16 host_cmd_watting_count = (UInt16)host_cmds.
                                            Where(cmd => cmd.TRANSFERSTATE < E_TRAN_STATUS.Transferring).
                                            Count();

            line.CurrntCSTStatueTransferCount = carrier_transferring_count;
            line.CurrntCSTStatueWaitingCount  = carrier_watting_count;
            line.CurrntHostCommandTransferStatueAssignedCount = host_cmd_assigned_count;
            line.CurrntHostCommandTransferStatueWaitingCounr  = host_cmd_watting_count;
        }
Esempio n. 4
0
        //GET: Admin/Vehicle/Create
        public ActionResult Create()
        {
            SetActiveMenuItem();
            try
            {
                //Sending zero to this function will still retrieve the correct lists see the sp GetVehicleDetailsDataSet for details
                var model = VehicleBLL.GetVehicleDetails(0);



                //Set the temp data so that every time there is an error we rebuild our dropdown lists without making SQL requests
                TempData["VehicleManufacturerList"] = model.VehicleManufacturerList;
                //TempData["VehicleModelList"] = model.VehicleModelList;
                TempData["VehicleTransmissionList"] = model.VehicleTransmissionList;
                TempData["VehicleGroupList"]        = model.VehicleGroupList;
                TempData["VehicleFuelList"]         = model.VehicleFuelList;

                //Finally we can return the partially completed model
                return(View(model));
            }
            catch (Exception ex)
            {
                TempData["ErrorMessage"] = ex.Message;
                return(Redirect("~/Admin/Home/Error"));
            }
        }
 private void PopulateComboBox()
 {
     aVehicleBll = new VehicleBLL();
     vehicleRegNoComboBox.DisplayMember = "RegNO";
     List<Vehicle> vehicles = aVehicleBll.GetAllVehicle();
     vehicleRegNoComboBox.DataSource = vehicles;
 }
 protected string GetVehicleDetail(object o)
 {
     try
     {
         if (o != null)
         {
             Vehicle veh = VehicleBLL.GetVehicle(int.Parse(o.ToString()));
             if (veh != null)
             {
                 return(veh.Name + "(" + veh.PlateNo + ")");
             }
             else
             {
                 return("");
             }
         }
         else
         {
             return("");
         }
     }
     catch
     {
         return("");
     }
 }
Esempio n. 7
0
        private void InlineEfficiencyMonitor()
        {
            ALINE      line       = scApp.getEQObjCacheManager().getLine();
            VehicleBLL vehicleBLL = scApp.VehicleBLL;
            CMDBLL     cmdBLL     = scApp.CMDBLL;

            line.CurrntVehicleModeAutoRemoteCount = vehicleBLL.cache.getVhCurrentModeInAutoRemoteCount();
            line.CurrntVehicleModeAutoLoaclCount  = vehicleBLL.cache.getVhCurrentModeInAutoLocalCount();
            line.CurrntVehicleStatusIdelCount     = vehicleBLL.cache.getVhCurrentStatusInIdleCount();
            line.CurrntVehicleStatusErrorCount    = vehicleBLL.cache.getVhCurrentStatusInErrorCount();
            var    host_cmds = cmdBLL.loadACMD_MCSIsUnfinished();
            UInt16 carrier_transferring_count = (UInt16)host_cmds.
                                                Where(cmd => cmd.TRANSFERSTATE == E_TRAN_STATUS.Transferring).
                                                Count();
            UInt16 carrier_watting_count = (UInt16)host_cmds.
                                           Where(cmd => cmd.TRANSFERSTATE < E_TRAN_STATUS.Transferring).
                                           Count();
            UInt16 host_cmd_assigned_count = (UInt16)host_cmds.
                                             Where(cmd => cmd.TRANSFERSTATE >= E_TRAN_STATUS.Initial).
                                             Count();
            UInt16 host_cmd_watting_count = (UInt16)host_cmds.
                                            Where(cmd => cmd.TRANSFERSTATE < E_TRAN_STATUS.Initial).
                                            Count();

            line.CurrntCSTStatueTransferCount = carrier_transferring_count;
            line.CurrntCSTStatueWaitingCount  = carrier_watting_count;
            line.CurrntHostCommandTransferStatueAssignedCount = host_cmd_assigned_count;
            line.CurrntHostCommandTransferStatueWaitingCounr  = host_cmd_watting_count;
        }
Esempio n. 8
0
        public ActionResult GetUserVehiclesByPlateNum(string plateNum)
        {
            List <UserVehiclesModel> list = new List <UserVehiclesModel>();

            // 默认模式
            if (base.VehicleViewMode)
            {
                list = VehicleBLL.GetDefaultVehiclesAndStrucNameByPlateNum(base.CurrentStrucID, plateNum);
            }
            else
            {
                list = VehicleBLL.GetVehiclesAndStrucNameByPlateNum(base.CurrentUserID, plateNum);
            }
            List <dynamic> resultList = new List <dynamic>();

            foreach (var item in list)
            {
                resultList.Add(new
                {
                    label     = item.PlateNum + "[" + item.StrucName + "]",
                    value     = item.PlateNum,
                    VID       = item.VID,
                    strucName = item.StrucName,
                    VIN       = item.VIN
                });
            }
            return(Json(resultList, JsonRequestBehavior.AllowGet));
        }
Esempio n. 9
0
 private void BindVehList()
 {
     usr = (User)Session["user"];
     ddlVeh.DataTextField  = "Name";
     ddlVeh.DataValueField = "ID";
     ddlVeh.DataSource     = VehicleBLL.GetVehicleLookUpList(usr.LocationID.Value);
     ddlVeh.DataBind();
 }
Esempio n. 10
0
        public ActionResult GetUserVehiclesByVehicleName(string vehicleName)
        {
            var            list       = VehicleBLL.GetVehiclesAndStrucName(base.CurrentUserID, vehicleName);
            List <dynamic> resultList = new List <dynamic>();

            foreach (var item in list)
            {
                resultList.Add(new { label = item.VehicleName + "[" + item.StrucName + "]", value = item.VehicleName, VID = item.VID });
            }
            return(Json(resultList, JsonRequestBehavior.AllowGet));
        }
Esempio n. 11
0
 public ActionResult GetAll()
 {
     try
     {
         return(Json(VehicleBLL.FindAll()));
     }
     catch (Exception appException)
     {
         throw appException;
     }
 }
Esempio n. 12
0
 public ActionResult GetVehicletById([FromRoute] int id)
 {
     try
     {
         return(Json(VehicleBLL.FindById(id)));
     }
     catch (Exception appException)
     {
         throw appException;
     }
 }
Esempio n. 13
0
 public ActionResult GetVehicletByBrand([FromRoute] string brand)
 {
     try
     {
         return(Json(VehicleBLL.FindByBrand(brand)));
     }
     catch (Exception appException)
     {
         throw appException;
     }
 }
Esempio n. 14
0
 public ActionResult Save([FromBody] Vehicle _vehicle)
 {
     try
     {
         return(Json(VehicleBLL.Save(_vehicle)));
     }
     catch (Exception appException)
     {
         throw appException;
     }
 }
Esempio n. 15
0
 public ActionResult Delete([FromBody] IList <Int32> _ids)
 {
     try
     {
         return(Json(VehicleBLL.Delete(_ids)));
     }
     catch (Exception appException)
     {
         throw appException;
     }
 }
Esempio n. 16
0
        public ActionResult GetVehicleIDByPlateNum(string PlateNum)
        {
            base.FixVaryBug();
            var            list       = VehicleBLL.GetVehiclesByPlateNum(PlateNum, this.CurrentStrucID);
            List <dynamic> resultList = new List <dynamic>();

            foreach (var item in list)
            {
                resultList.Add(new { value = item.PlateNum, label = item.PlateNum, ID = item.ID });
            }
            return(Json(resultList, JsonRequestBehavior.AllowGet));
        }
        protected void LoadVehicleTypes()
        {
            DataTable vTypeDataTable = VehicleBLL.vehicleGetTypeBrandMake(Int32.Parse(uoDropDownListVehicleBranch.SelectedValue));
            ListItem  item           = new ListItem("--Select Vehicle Type--", "0");

            uoDropDownListVehicleType.Items.Clear();
            uoDropDownListVehicleType.Items.Add(item);
            uoDropDownListVehicleType.DataSource     = vTypeDataTable;
            uoDropDownListVehicleType.DataTextField  = "vehicleType";
            uoDropDownListVehicleType.DataValueField = "colVehicleIdBigint";
            uoDropDownListVehicleType.DataBind();
            ViewState["vTypeDataTable"] = vTypeDataTable;
        }
Esempio n. 18
0
        public VehicleForm()
        {
            _vehicleService = new VehicleBLL();
            InitializeComponent();
            vehicleTypeBll = new VehicleTypeBLL();
            stationBll     = new StationBLL();

            vehicleTypes = vehicleTypeBll.GetAll();
            stations     = stationBll.GetAll();

            cmbVehicleTypeId.DataSource = vehicleTypes;
            cmbStationId.DataSource     = stations;
        }
 protected void gvVehicle_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         string format = "dd/MM/yyyy";
         hid.Value       = "Update";
         dvDel.Visible   = true;
         dvID.Visible    = true;
         dvMsg.InnerText = "Update Vehicle's Information :";
         btnSubmit.Text  = "Update";
         int     Id  = Convert.ToInt32(gvVehicle.SelectedDataKey[0].ToString());
         Vehicle veh = null;
         veh                       = VehicleBLL.GetVehicle(Id);
         txtID.Text                = Id.ToString();
         txtName.Text              = veh.Name;
         ddlDriver.SelectedValue   = veh.AssociatedDriver.ToString();
         txtCapacity.Text          = veh.Capacity.HasValue?veh.Capacity.Value.ToString():"";
         ddlInsur.SelectedValue    = veh.InsuranceCompany.HasValue?veh.InsuranceCompany.ToString():"";
         txtLicense.Text           = veh.LicenseNo.ToString();
         txtIDate.Text             = veh.InsuranceExprDate.HasValue?DateTime.Parse(veh.InsuranceExprDate.Value.ToString()).ToString(format):"";
         txtInsur.Text             = veh.InsuranceNo;
         txtLDate.Text             = veh.LicenseExprDate.HasValue?DateTime.Parse(veh.LicenseExprDate.Value.ToString()).ToString(format):"";
         txtLicense.Text           = veh.LicenseNo;
         ddlMaker.SelectedValue    = veh.MarkerID.HasValue?veh.MarkerID.Value.ToString():"";
         txtMilage.Text            = veh.Mileage.HasValue ? veh.Mileage.Value.ToString() : "";
         txtplate.Text             = veh.PlateNo;
         ddlTracker.SelectedValue  = veh.TrackerCompany.HasValue?veh.TrackerCompany.Value.ToString():"";
         ddlVehType.SelectedValue  = veh.TypeID.HasValue? veh.TypeID.Value.ToString():"";
         txtEngNo.Text             = veh.EngineNo;
         txtChasis.Text            = veh.ChasisNo;
         ddlLocation.SelectedValue = veh.LocationID.HasValue ? veh.LocationID.Value.ToString() : "";
         if (veh.DelFlg != null)
         {
             if (veh.DelFlg == "Y")
             {
                 chk.Checked = true;
             }
             if (veh.DelFlg == "N")
             {
                 chk.Checked = false;
             }
         }
     }
     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);
     }
 }
Esempio n. 20
0
        public IncidentListForm()
        {
            _incidentService = new IncidentBLL();
            InitializeComponent();

            stationBll = new StationBLL();
            stations   = stationBll.GetAll();

            vehicleBLL = new VehicleBLL();

            cmbStation.DataSource = stations;
            txtFirstname.Text     = ApplicationCookie.CurrentUser.Name;
            txtLastname.Text      = ApplicationCookie.CurrentUser.Surname;
        }
 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
     {
     }
 }
Esempio n. 22
0
        private void vehicleGetCompany()
        {
            /// <summary>
            /// Date Created: 27/07/2011
            /// Created By: Gabriel Oquialda
            /// (description) Load vendor name to dropdownlist
            /// </summary>

            DataTable dt = new DataTable();

            dt = VehicleBLL.vehicleGetCompany();
            uoDropDownListVehicleCompany.DataSource     = dt;
            uoDropDownListVehicleCompany.DataTextField  = "VendorName";
            uoDropDownListVehicleCompany.DataValueField = "VendorId";
            uoDropDownListVehicleCompany.DataBind();
        }
Esempio n. 23
0
        public ActionResult Edit(VehicleViewModel model)
        {
            SetActiveMenuItem();
            TempData.Keep();
            //Repopulate the dropdown lists of vehicle attributes without asking SQL again
            model.VehicleManufacturerList = (SelectList)TempData["VehicleManufacturerList"];
            model.VehicleModelList        = (SelectList)TempData["VehicleModelList"];
            model.VehicleTransmissionList = (SelectList)TempData["VehicleTransmissionList"];
            model.VehicleGroupList        = (SelectList)TempData["VehicleGroupList"];
            model.VehicleFuelList         = (SelectList)TempData["VehicleFuelList"];


            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            try
            {
                var FullName = Request.Cookies["userInfo"]["FullName"];
                //Now update the record
                var result = VehicleBLL.UpdateVehicle((int)model.VehicleID,
                                                      model.ModelID,
                                                      model.RegistrationNumber,
                                                      model.CurrentMileage,
                                                      model.TransmissionID,
                                                      model.VehicleGroupID,
                                                      model.FuelID,
                                                      FullName);

                //Take our ID with us to the confirmation form
                ViewBag.Id = model.VehicleID;
                //Clear any temp data
                TempData.Clear();
                //Determine the kind of SQL transaction we have performed
                ViewBag.Message = "updated";
                //We can now safely go to the confirmation view
                return(View("AddUpdateConfirm"));
            }
            catch (Exception ex)
            {
                TempData["ErrorMessage"] = ex.Message;
                return(Redirect("~/Admin/Home/Error"));
            }
        }
        public void start(SCApplication app)
        {
            scApp = app;
            List <AEQPT> eqpts = app.getEQObjCacheManager().getAllEquipment();

            foreach (var eqpt in eqpts)
            {
                if (eqpt is IMaintainDevice)
                {
                    IMaintainDevice maintainDevice = eqpt as IMaintainDevice;
                    if (maintainDevice is MaintainSpace)
                    {
                        MaintainSpace maintainSpace = eqpt as MaintainSpace;
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.Plc_Link_Stat), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.Is_Eq_Alive), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.MTxMode), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.Interlock), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.CurrentCarID), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.CurrentPreCarOurDistance), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.SynchronizeTime), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.CarOutInterlock), PublishMTSInfo);
                        maintainSpace.addEventHandler(nameof(MTLService), nameof(maintainSpace.CarInMoving), PublishMTSInfo);
                    }
                    else if (maintainDevice is MaintainLift)
                    {
                        MaintainLift maintainLift = eqpt as MaintainLift;
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.Plc_Link_Stat), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.Is_Eq_Alive), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.MTxMode), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.Interlock), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.CurrentCarID), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.MTLLocation), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.CurrentPreCarOurDistance), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.SynchronizeTime), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.CarOutInterlock), PublishMTLInfo);
                        maintainLift.addEventHandler(nameof(MTLService), nameof(maintainLift.CarInMoving), PublishMTLInfo);
                    }
                }
            }

            VehicleService = app.VehicleService;
            vehicleBLL     = app.VehicleBLL;
            reportBLL      = app.ReportBLL;
            //  mtl = app.getEQObjCacheManager().getEquipmentByEQPTID("MTL") as MaintainLift;
        }
 private void SubscriberNatsEvent()
 {
     try
     {
         foreach (var vh in ObjCacheManager.GetVEHICLEs())
         {
             string subject_id = string.Format(NATS_SUBJECT_VH_INFO_0, vh.VEHICLE_ID);
             VehicleBLL.SubscriberVehicleInfo(subject_id, VehicleBLL.ProcVehicleInfo);
             System.Threading.Thread.Sleep(50);
         }
         LineBLL.SubscriberLineInfo(NATS_SUBJECT_LINE_INFO, LineBLL.ProcLineInfo);
         GetNatsManager().Subscriber(NATS_SUBJECT_CURRENT_ALARM, ProcCurrentAlarm);
     }
     catch (Exception ex)
     {
         logger.Error(ex, "Exception");
     }
 }
Esempio n. 26
0
        private void vehicleGetType()
        {
            /// <summary>
            /// Date Created: 12/08/2011
            /// Created By: Gabriel Oquialda
            /// (description) Load vehicle type to dropdownlist
            /// </summary>

            int       VendorID = 0;
            DataTable dt       = new DataTable();

            VendorID = Convert.ToInt32(uoDropDownListVehicleCompany.SelectedValue);
            dt       = VehicleBLL.vehicleGetType(VendorID);
            uoDropDownListVehicleType.DataSource     = dt;
            uoDropDownListVehicleType.DataTextField  = "VehicleName";
            uoDropDownListVehicleType.DataValueField = "VehicleId";
            uoDropDownListVehicleType.DataBind();
        }
        /// Date Created:   05/Jan/2015
        /// Created By:     Josephine Monteza
        /// (description)   tag record to TblTag_Hotel
        /// -------------------------------------------
        private void TagSeafarer(string sIdBigint, string sTRId, string sVendorID, string sRecLoc, string sE1Id, string sStatusOnOff)
        {
            string sUser = uoHiddenFieldUser.Value;
            string sRole = uoHiddenFieldRole.Value;

            string   strLogDescription = "Tag Seafarer To Vehicle Service Provider";
            string   strFunction       = "TagSeafarer";
            DateTime dateNow           = CommonFunctions.GetCurrentDateTime();

            VehicleBLL.TagtoVehicle(GlobalCode.Field2Long(sIdBigint), GlobalCode.Field2Long(sTRId), sRecLoc,
                                    GlobalCode.Field2Long(sE1Id), sStatusOnOff, 0, GlobalCode.Field2Int(sVendorID), "1",
                                    uoHiddenFieldUser.Value, strLogDescription, strFunction, Path.GetFileName(Request.Path));

            if (sVendorID != "0")
            {
                BindVehicleManifest(1);
            }
        }
Esempio n. 28
0
        public void start(SCApplication app)
        {
            vehicleBLL          = app.VehicleBLL;
            vehicleService      = app.VehicleService;
            segmentBLL          = app.SegmentBLL;
            addressesBLL        = app.AddressesBLL;
            guideBLL            = app.GuideBLL;
            cmdBLL              = app.CMDBLL;
            unitBLL             = app.UnitBLL;
            commObjCacheManager = app.getCommObjCacheManager();
            var vhs = app.getEQObjCacheManager().getAllVehicle();

            foreach (AVEHICLE vh in vhs)
            {
                vh.CommandComplete       += Vh_CommandComplete;
                vh.BatteryLevelChange    += Vh_BatteryLevelChange;
                vh.BatteryCapacityChange += Vh_BatteryCapacityChange;
            }
        }
Esempio n. 29
0
 //GET: Admin/Vehicle/Edit
 public ActionResult Edit(int id)
 {
     SetActiveMenuItem();
     try
     {
         var model = VehicleBLL.GetVehicleDetails(id);
         //Set the temp data so that every time there is an error we rebuild our dropdown lists without making SQL requests
         TempData["VehicleManufacturerList"] = model.VehicleManufacturerList;
         TempData["VehicleModelList"]        = model.VehicleModelList;
         TempData["VehicleTransmissionList"] = model.VehicleTransmissionList;
         TempData["VehicleGroupList"]        = model.VehicleGroupList;
         TempData["VehicleFuelList"]         = model.VehicleFuelList;
         return(View(model));
     }
     catch (Exception ex)
     {
         TempData["ErrorMessage"] = ex.Message;
         return(Redirect("~/Admin/Home/Error"));
     }
 }
        private void showButton_Click(object sender, EventArgs e)
        {
            vehicleDetailsListView.Items.Clear();
            aRentalInformationBll = new RentalInformationBLL();
            aVehicleBll = new VehicleBLL();
            Vehicle selectedVehicleRegNo = (Vehicle)vehicleRegNoComboBox.SelectedItem;
            string regNo = selectedVehicleRegNo.RegNO;
            List<RentalInformation> rentalInformations = aRentalInformationBll.GetAllRentalDetails(regNo);
            foreach (RentalInformation aRentalInformation in rentalInformations)
            {

                ListViewItem item = new ListViewItem(aRentalInformation.RentDate.ToString());
                item.SubItems.Add(aRentalInformation.Destination);
                item.SubItems.Add(aRentalInformation.Payment.ToString());
                item.SubItems.Add(aRentalInformation.Profit.ToString());
                item.SubItems.Add(aRentalInformation.Commission.ToString());
                item.SubItems.Add(aRentalInformation.PaymentStatus);

                vehicleDetailsListView.Items.Add(item);
            }
        }
 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)
     {
     }
 }
Esempio n. 32
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();
            }
        }