public static FuelCorrectionObject FuelRowToObject(DataRow Fuel)
        {
            FuelCorrectionObject obj = new FuelCorrectionObject();

            try
            {
                if (Fuel != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Fuel, FuelCorrectionObject.FUELCOR_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.FuelCorID           = RowFunctions.GetValueFromRowToGuid(Fuel, FuelCorrectionObject.FUELCOR_ID, true, DataRowVersion.Current);
                        obj.DateFrom            = RowFunctions.GetValueFromRowToString(Fuel, FuelCorrectionObject.DATE_FROM, false, DataRowVersion.Current);
                        obj.DateTo              = RowFunctions.GetValueFromRowToString(Fuel, FuelCorrectionObject.DATE_TO, false, DataRowVersion.Current);
                        obj.Quantity            = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelCorrectionObject.QUANTITY, false, DataRowVersion.Current);
                        obj.MaxQuantity         = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelCorrectionObject.MAXQUANTITY, false, DataRowVersion.Current);
                        obj.VehiclesNotIncluded = RowFunctions.GetValueFromRowToString(Fuel, FuelCorrectionObject.VEHICLES_NOT_INCLUDED, false, DataRowVersion.Current);
                        obj.SuppliersIncluded   = RowFunctions.GetValueFromRowToString(Fuel, FuelCorrectionObject.SUPPLIERS_INCLUDED, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
        public static FuelDeliveryObject FuelDeliveryRowToObject(DataRow FuelDelivery)
        {
            FuelDeliveryObject obj = new FuelDeliveryObject();

            try
            {
                if (FuelDelivery != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.FuelDeliveryID = RowFunctions.GetValueFromRowToGuid(FuelDelivery, FuelDeliveryObject.FUELDEL_ID, true, DataRowVersion.Current);
                        obj.Supplier       = SupplierConvertor.SupplierRowToObject(FuelDelivery);
                        obj.DateDelivery   = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_DELIVERY, false, DataRowVersion.Current);
                        obj.DateInvoice    = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.DATE_INVOICE, false, DataRowVersion.Current);
                        obj.Quantity       = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.QUANTITY, false, DataRowVersion.Current);
                        obj.UnityPrice     = RowFunctions.GetValueFromRowToDecimal(FuelDelivery, FuelDeliveryObject.UNITY_PRICE, false, DataRowVersion.Current);
                        obj.Location       = (Framework.Common.Enumeration.Fuel.Location)RowFunctions.GetValueFromRowToInteger(FuelDelivery, FuelDeliveryObject.LOCATION, false, DataRowVersion.Current);
                        obj.Remark         = RowFunctions.GetValueFromRowToString(FuelDelivery, FuelDeliveryObject.REMARK, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
Exemple #3
0
        public static FuelObject FuelRowToObject(DataRow Fuel)
        {
            FuelObject obj = new FuelObject();

            try
            {
                if (Fuel != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Fuel, FuelObject.FUEL_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.FuelID            = RowFunctions.GetValueFromRowToGuid(Fuel, FuelObject.FUEL_ID, true, DataRowVersion.Current);
                        obj.Transi_TNR_reg    = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSI_TNR_REG, false, DataRowVersion.Current);
                        obj.Transi_TNR_person = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSI_TNR_PERSON, false, DataRowVersion.Current);
                        obj.Transi_TNR_mat    = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSI_TNR_MAT, false, DataRowVersion.Current);
                        obj.Transi_TNR_pump   = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSI_TNR_PUMP, false, DataRowVersion.Current);
                        obj.Transi_TNR_tank   = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSI_TNR_TANK, false, DataRowVersion.Current);
                        obj.Transi_FuelType   = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSI_FUELTYPE, false, DataRowVersion.Current);
                        obj.Transc_FuelId     = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSC_FUELID, false, DataRowVersion.Current);
                        obj.Transc_NawID      = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSC_NAWID, false, DataRowVersion.Current);
                        //obj.Transc_Date = RowFunctions.GetValueFromRowToInt64(Fuel, FuelObject.TRANSC_DATE, false, DataRowVersion.Current);
                        obj.Transc_PriveBedrijf = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.TRANSC_PRIVEBEDRIJF, false, DataRowVersion.Current);
                        obj.Transc_Product      = RowFunctions.GetValueFromRowToString(Fuel, FuelObject.TRANSC_PRODUCT, false, DataRowVersion.Current);
                        obj.Date                    = RowFunctions.GetValueFromRowToDateTime(Fuel, FuelObject.DATE, false, DataRowVersion.Current);
                        obj.EmployeeName            = RowFunctions.GetValueFromRowToString(Fuel, FuelObject.EMPLOYEE_NAME, false, DataRowVersion.Current).Trim();
                        obj.Employee                = RowFunctions.GetValueFromRowToString(Fuel, FuelObject.EMPLOYEE, false, DataRowVersion.Current).Trim();
                        obj.VehicleLicensePlate     = RowFunctions.GetValueFromRowToString(Fuel, FuelObject.VEHICLE_LICENSEPLATE, false, DataRowVersion.Current).Trim();
                        obj.VehicleKilometreCounter = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.VEHICLE_KILOMETRECOUNTER, false, DataRowVersion.Current);
                        obj.Quantity                = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelObject.QUANTITY, false, DataRowVersion.Current);
                        obj.QuantityCorrection      = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelObject.QUANTITY_CORRECTION, false, DataRowVersion.Current);
                        obj.FullTank                = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelObject.FULLTANK, false, DataRowVersion.Current);
                        obj.UnityPrice              = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelObject.UNITYPRICE, false, DataRowVersion.Current);
                        obj.TotalPrice              = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelObject.TOTALPRICE, false, DataRowVersion.Current);
                        obj.Unit                    = RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.UNIT, false, DataRowVersion.Current);
                        obj.Supplier                = RowFunctions.GetValueFromRowToString(Fuel, FuelObject.SUPPLIER, false, DataRowVersion.Current).Trim();
                        obj.Location                = RowFunctions.GetValueFromRowToString(Fuel, FuelObject.LOCATION, false, DataRowVersion.Current);
                        obj.FuelType                = (Framework.Common.Enumeration.Fuel.FuelType)RowFunctions.GetValueFromRowToInteger(Fuel, FuelObject.FUELTYPE, false, DataRowVersion.Current);
                        obj.Btw                      = RowFunctions.GetValueFromRowToDecimal(Fuel, FuelObject.BTW, false, DataRowVersion.Current);
                        obj.PrivateTanking           = RowFunctions.GetValueFromRowToBoolean(Fuel, FuelObject.PRIVATE_TANKING, false, DataRowVersion.Current);
                        obj.CompanyTanking           = RowFunctions.GetValueFromRowToBoolean(Fuel, FuelObject.COMPANY_TANKING, false, DataRowVersion.Current);
                        obj.InvoiceReceived          = RowFunctions.GetValueFromRowToBoolean(Fuel, FuelObject.INVOICE_RECEIVED, false, DataRowVersion.Current);
                        obj.InvoiceOK                = RowFunctions.GetValueFromRowToBoolean(Fuel, FuelObject.INVOICE_OK, false, DataRowVersion.Current);
                        obj.DateMailForbiddenFueling = PROF_IT.Common.Convert.DateFunctions.DBDateToDateTime(RowFunctions.GetValueFromRowToString(Fuel, FuelObject.DATEMAIL_FORBIDDENFUELING, false, DataRowVersion.Current), false);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
Exemple #4
0
        public static TurnOverObject CustomerRowToObject(DataRow turnOvers)
        {
            TurnOverObject obj = new TurnOverObject();

            try
            {
                if (turnOvers != null)
                {
                    if (turnOvers.Table.Columns.Contains(TurnOverObject.TNR_ID))
                    {
                        obj.TnrID = RowFunctions.GetValueFromRowToInteger(turnOvers, TurnOverObject.TNR_ID, true, DataRowVersion.Current);
                    }

                    if (turnOvers.Table.Columns.Contains(TurnOverObject.YEAR))
                    {
                        obj.Year = RowFunctions.GetValueFromRowToInteger(turnOvers, TurnOverObject.YEAR, false, DataRowVersion.Current);
                    }

                    if (turnOvers.Table.Columns.Contains(TurnOverObject.MONTH))
                    {
                        obj.Month = RowFunctions.GetValueFromRowToInteger(turnOvers, TurnOverObject.MONTH, false, DataRowVersion.Current);
                    }

                    if (turnOvers.Table.Columns.Contains(TurnOverObject.DATE))
                    {
                        obj.Date = RowFunctions.GetValueFromRowToString(turnOvers, TurnOverObject.DATE, true, DataRowVersion.Current);
                    }

                    if (turnOvers.Table.Columns.Contains(TurnOverObject.VEHICLE))
                    {
                        obj.Vehicle = RowFunctions.GetValueFromRowToString(turnOvers, TurnOverObject.VEHICLE, true, DataRowVersion.Current);
                    }

                    if (turnOvers.Table.Columns.Contains(TurnOverObject.TURNOVER))
                    {
                        obj.TurnOver = RowFunctions.GetValueFromRowToDecimal(turnOvers, TurnOverObject.TURNOVER, true, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
        public static MaterialObject MaterialRowToObject(DataRow Material)
        {
            MaterialObject obj = new MaterialObject();

            try
            {
                if (Material != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Material, MaterialObject.MAT_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.MatID               = RowFunctions.GetValueFromRowToGuid(Material, MaterialObject.MAT_ID, true, DataRowVersion.Current);
                        obj.MaterialCategory    = MaterialCategoryConvertor.MaterialCategoryRowToObject(Material, "");
                        obj.MaterialType        = MaterialTypeConvertor.MaterialTypeRowToObject(Material, "");
                        obj.MaterialSubType     = MaterialSubTypeConvertor.MaterialSubTypeRowToObject(Material, "");
                        obj.EmployeeCreator     = EmployeeConvertor.EmployeeRowToObject(Material, "Creator");
                        obj.EmployeeResponsable = EmployeeConvertor.EmployeeRowToObject(Material, "Responsable");
                        obj.Vehicle             = VehicleConvertor.VehicleRowToObject(Material);
                        obj.Supplier            = SupplierConvertor.SupplierRowToObject(Material);
                        obj.Name                 = RowFunctions.GetValueFromRowToString(Material, MaterialObject.NAME, false, DataRowVersion.Current);
                        obj.Description          = RowFunctions.GetValueFromRowToString(Material, MaterialObject.DESCRIPTION, false, DataRowVersion.Current);
                        obj.Type                 = (TIS.Framework.Common.Enumeration.Material.Type)RowFunctions.GetValueFromRowToInteger(Material, MaterialObject.TYPE, false, DataRowVersion.Current);
                        obj.SerieNumber          = RowFunctions.GetValueFromRowToString(Material, MaterialObject.SERIE_NUMBER, false, DataRowVersion.Current);
                        obj.InternalNumber       = RowFunctions.GetValueFromRowToString(Material, MaterialObject.INTERNAL_NUMBER, false, DataRowVersion.Current);
                        obj.PurchasedOn          = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Material, MaterialObject.PURCHASEDON, false, DataRowVersion.Current), false);
                        obj.Price                = RowFunctions.GetValueFromRowToDecimal(Material, MaterialObject.PRICE, false, DataRowVersion.Current);
                        obj.NextMaintenance      = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(Material, MaterialObject.NEXT_MAINTENANCE, false, DataRowVersion.Current), false);
                        obj.MaintenanceFrequency = RowFunctions.GetValueFromRowToInteger(Material, MaterialObject.MAINTENANCE_FREQUENCY, false, DataRowVersion.Current);
                        obj.Broken               = RowFunctions.GetValueFromRowToBoolean(Material, MaterialObject.BROKEN, false, DataRowVersion.Current);
                        obj.Active               = RowFunctions.GetValueFromRowToBoolean(Material, MaterialObject.ACTIVE, false, DataRowVersion.Current);
                    }

                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }