Exemplo n.º 1
0
        public static bool UpdateDriverVehicle(VehicleDS vehicle)
        {
            //Update an existing driver vehicle
            bool result = false;

            try {
                result = Mediator.ExecuteNonQuery("", new object[] { vehicle });
            }
            catch (Exception ex) { throw ex; }
            return(result);
        }
Exemplo n.º 2
0
        public static int CreateDriverVehicle(VehicleDS vehicle)
        {
            //Create a new driver vehicle
            int result = 0;

            try {
                result = (int)Mediator.ExecuteNonQueryWithReturn("", new object[] { vehicle });
            }
            catch (Exception ex) { throw ex; }
            return(result);
        }
Exemplo n.º 3
0
        public static VehicleDS ViewDriverVehicles()
        {
            //Get a list of driver vehicles
            VehicleDS vehicles = new VehicleDS();

            try {
                DataSet ds = Mediator.FillDataset("", "VehicleListTable", null);
                if (ds != null)
                {
                    vehicles.Merge(ds.Tables["VehicleListTable"].Select("", "Description", DataViewRowState.CurrentRows));
                }
            }
            catch (Exception ex) { throw ex; }
            return(vehicles);
        }
Exemplo n.º 4
0
        //Interface
        public dlgVehicleDetail(ref VehicleDS vehicle)
        {
            //Constructor
            try {
                //
                InitializeComponent();
                this.btnOk.Text     = CMD_OK;
                this.btnCancel.Text = CMD_CANCEL;

                //Set mediator service, data, and titlebar caption
                this.mVehicleDS = vehicle;
                if (this.mVehicleDS.VehicleDetailTable.Count > 0)
                {
                    this.mVehicleID = this.mVehicleDS.VehicleDetailTable[0].VehicleID;
                    this.Text       = (this.mVehicleID > 0) ? "Driver Vehicle (" + this.mVehicleID + ")" : "Driver Vehicle (New)";
                }
                else
                {
                    this.Text = "Driver Vehicle (Data Unavailable)";
                }
            }
            catch (Exception ex) { throw ex; }
        }
Exemplo n.º 5
0
        public static VehicleDS GetDriverVehicle(int vehicleID, string vehicleType)
        {
            //Get a new or existing vehicle
            VehicleDS vehicle = new VehicleDS();

            try {
                if (vehicleID == 0)
                {
                    //New
                    VehicleDS.VehicleDetailTableRow row = vehicle.VehicleDetailTable.NewVehicleDetailTableRow();
                    row.VehicleID      = vehicleID;
                    row.Description    = "";
                    row.VehicleType    = vehicleType;
                    row.LicPlateNumber = "";
                    //row.State = "";
                    row.CarrierID = EnterpriseFactory.CompanyID;
                    //row.DriverID = 0;
                    row.IsActive    = true;
                    row.LastUpdated = DateTime.Now;
                    row.UserID      = System.Environment.UserName;
                    row.RowVersion  = "";
                    vehicle.VehicleDetailTable.AddVehicleDetailTableRow(row);
                }
                else
                {
                    //Existing
                    DataSet ds = Mediator.FillDataset("", "VehicleDetailTable", new object[] { vehicleID, vehicleType });
                    if (ds != null)
                    {
                        vehicle.Merge(ds);
                    }
                }
            }
            catch (Exception ex) { throw ex; }
            return(vehicle);
        }