예제 #1
0
        public static VehicleTypeObject VehicleTypeRowToObject(DataRow VehicleType)
        {
            VehicleTypeObject obj = new VehicleTypeObject();

            try
            {
                if (VehicleType != null)
                {
                    if (RowFunctions.GetValueFromRowToInt64(VehicleType, VehicleTypeObject.VEHTID, false, DataRowVersion.Current) != Constants.NullInt)
                    {
                        obj.VehtID             = RowFunctions.GetValueFromRowToInteger(VehicleType, VehicleTypeObject.VEHTID, true, DataRowVersion.Current);
                        obj.Transc_VehicleType = RowFunctions.GetValueFromRowToInteger(VehicleType, VehicleTypeObject.TRANSC_VEHICLETYPE, false, DataRowVersion.Current);
                        obj.Type = RowFunctions.GetValueFromRowToString(VehicleType, VehicleTypeObject.TYPE, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #2
0
        public static VehicleTransicsLinkObject VehicleTransicsLinkRowToObject(DataRow VehicleTransicsLink)
        {
            VehicleTransicsLinkObject obj = new VehicleTransicsLinkObject();

            try
            {
                if (VehicleTransicsLink != null)
                {
                    if (RowFunctions.GetValueFromRowToInteger(VehicleTransicsLink, VehicleTransicsLinkObject.VEHTI_ID, false, DataRowVersion.Current) != 0)
                    {
                        obj.VehtiID          = RowFunctions.GetValueFromRowToInteger(VehicleTransicsLink, VehicleTransicsLinkObject.VEHTI_ID, true, DataRowVersion.Current);
                        obj.Transi_TNR_mat   = RowFunctions.GetValueFromRowToInteger(VehicleTransicsLink, VehicleTransicsLinkObject.TRANSI_TNR_MAT, false, DataRowVersion.Current);
                        obj.Transc_VehicleID = RowFunctions.GetValueFromRowToInteger(VehicleTransicsLink, VehicleTransicsLinkObject.TRANSC_VEHICLEID, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #3
0
        public static TaskObject TaskRowToObject(DataRow task)
        {
            TaskObject obj = new TaskObject();

            try
            {
                if (task != null)
                {
                    obj.TaskID       = RowFunctions.GetValueFromRowToGuid(task, TaskObject.TASK_ID, true, DataRowVersion.Current);
                    obj.Tag          = RowFunctions.GetValueFromRowToString(task, TaskObject.TAG, true, DataRowVersion.Current);
                    obj.CreationDate = RowFunctions.GetValueFromRowToString(task, TaskObject.CREATION_DATE, true, DataRowVersion.Current);
                    obj.UpdateDate   = RowFunctions.GetValueFromRowToString(task, TaskObject.UPDATE_DATE, true, DataRowVersion.Current);
                    obj.DueDate      = RowFunctions.GetValueFromRowToString(task, TaskObject.DUE_DATE, true, DataRowVersion.Current);
                    //Do not upload the task description as default for performance issues.
                    obj.Status   = (Enumeration.Task.Status)RowFunctions.GetValueFromRowToInteger(task, TaskObject.STATUS, true, DataRowVersion.Current);
                    obj.Priority = (Enumeration.Task.Priority)RowFunctions.GetValueFromRowToInteger(task, TaskObject.PRIORITY, true, DataRowVersion.Current);
                    obj.Effort   = (Enumeration.Task.Effort)RowFunctions.GetValueFromRowToInteger(task, TaskObject.EFFORT, true, DataRowVersion.Current);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #4
0
        public static ScheduleObject ScheduleRowToObject(DataRow schedule)
        {
            ScheduleObject obj = new ScheduleObject();

            try
            {
                if (schedule != null)
                {
                    obj.SchedID   = RowFunctions.GetValueFromRowToGuid(schedule, ScheduleObject.SCHED_ID, true, DataRowVersion.Current);
                    obj.Frequency = (Enumeration.Frequency.TimeFrequency)RowFunctions.GetValueFromRowToInteger(schedule, ScheduleObject.FREQUENCY, true, DataRowVersion.Current);
                    obj.Monday    = RowFunctions.GetValueFromRowToBoolean(schedule, ScheduleObject.MONDAY, true, DataRowVersion.Current);
                    obj.Tuesday   = RowFunctions.GetValueFromRowToBoolean(schedule, ScheduleObject.TUESDAY, true, DataRowVersion.Current);
                    obj.Wednesday = RowFunctions.GetValueFromRowToBoolean(schedule, ScheduleObject.WEDNESDAY, true, DataRowVersion.Current);
                    obj.Thursday  = RowFunctions.GetValueFromRowToBoolean(schedule, ScheduleObject.THURSDAY, true, DataRowVersion.Current);
                    obj.Friday    = RowFunctions.GetValueFromRowToBoolean(schedule, ScheduleObject.FRIDAY, true, DataRowVersion.Current);
                    obj.Saterday  = RowFunctions.GetValueFromRowToBoolean(schedule, ScheduleObject.SATERDAY, true, DataRowVersion.Current);
                    obj.Sunday    = RowFunctions.GetValueFromRowToBoolean(schedule, ScheduleObject.SUNDAY, true, DataRowVersion.Current);
                    obj.StartDate = RowFunctions.GetValueFromRowToString(schedule, ScheduleObject.STARTDATE, true, DataRowVersion.Current);
                    obj.Time      = RowFunctions.GetValueFromRowToString(schedule, ScheduleObject.TIME, true, DataRowVersion.Current);
                    obj.LastSend  = RowFunctions.GetValueFromRowToString(schedule, ScheduleObject.LAST_SEND, true, DataRowVersion.Current);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #5
0
        public static VehicleObject VehicleRowToObject(DataRow Vehicle)
        {
            VehicleObject obj = new VehicleObject();

            try
            {
                if (Vehicle != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(Vehicle, VehicleObject.VEHID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.VehID              = RowFunctions.GetValueFromRowToGuid(Vehicle, VehicleObject.VEHID, true, DataRowVersion.Current);
                        obj.Transc_VehicleID   = RowFunctions.GetValueFromRowToInteger(Vehicle, VehicleObject.TRANSC_VEHICLE_ID, false, DataRowVersion.Current);
                        obj.Transc_VehicleType = RowFunctions.GetValueFromRowToInteger(Vehicle, VehicleObject.TRANSC_VEHICLE_TYPE, false, DataRowVersion.Current);
                        obj.Name                = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.NAME, false, DataRowVersion.Current);
                        obj.LicenseNumber       = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.LICENSE_NUMBER, false, DataRowVersion.Current);
                        obj.Euronorm            = RowFunctions.GetValueFromRowToInteger(Vehicle, VehicleObject.EURONORM, false, DataRowVersion.Current);
                        obj.Chassis             = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.CHASSIS, false, DataRowVersion.Current);
                        obj.Brand               = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.BRAND, false, DataRowVersion.Current);
                        obj.Icon                = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.ICON, false, DataRowVersion.Current);
                        obj.VehicleType         = RowFunctions.GetValueFromRowToString(Vehicle, VehicleObject.VEHICLETYPE, false, DataRowVersion.Current);
                        obj.VehicleTransicsLink = VehicleTransicsLinkConvertor.VehicleTransicsLinkRowToObject(Vehicle);
                        obj.ContactTransics     = RowFunctions.GetValueFromRowToBoolean(Vehicle, VehicleObject.CONTACT_TRANSICS, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #6
0
        public static VehicleMileageObject VehicleMileageRowToObject(DataRow VehicleMileage)
        {
            VehicleMileageObject obj = new VehicleMileageObject();

            try
            {
                if (VehicleMileage != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(VehicleMileage, VehicleMileageObject.VEHM_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.VehmID         = RowFunctions.GetValueFromRowToGuid(VehicleMileage, VehicleMileageObject.VEHM_ID, true, DataRowVersion.Current);
                        obj.Transi_TNR_mat = RowFunctions.GetValueFromRowToInteger(VehicleMileage, VehicleMileageObject.TRANSI_TNR_MAT, false, DataRowVersion.Current);
                        obj.Transi_NM_mat  = RowFunctions.GetValueFromRowToString(VehicleMileage, VehicleMileageObject.TRANSI_NM_MAT, false, DataRowVersion.Current);
                        obj.Date           = PROF_IT.Common.Convert.DateFunctions.DBDateToDate(RowFunctions.GetValueFromRowToString(VehicleMileage, VehicleMileageObject.DATE, false, DataRowVersion.Current));
                        obj.Mileage        = RowFunctions.GetValueFromRowToInteger(VehicleMileage, VehicleMileageObject.MILEAGE, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #7
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);
        }
예제 #8
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);
        }
예제 #9
0
        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);
        }
예제 #10
0
        public static SupplierObject SupplierRowToObject(DataRow supplier)
        {
            SupplierObject obj = null;

            try
            {
                if (supplier != null)
                {
                    if (RowFunctions.GetValueFromRowToGuid(supplier, SupplierObject.SUP_ID, false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj             = new SupplierObject();
                        obj.SupID       = RowFunctions.GetValueFromRowToGuid(supplier, SupplierObject.SUP_ID, true, DataRowVersion.Current);
                        obj.TranscID    = RowFunctions.GetValueFromRowToInteger(supplier, SupplierObject.TRANSC_ID, false, DataRowVersion.Current);
                        obj.TasID       = RowFunctions.GetValueFromRowToInteger(supplier, SupplierObject.TAS_ID, false, DataRowVersion.Current);
                        obj.Name        = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.NAME, false, DataRowVersion.Current);
                        obj.Name2       = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.NAME2, false, DataRowVersion.Current);
                        obj.Street      = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.STREET, false, DataRowVersion.Current);
                        obj.HouseNumber = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.HOUSE_NUMBER, false, DataRowVersion.Current);
                        obj.Zipcode     = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.ZIPCODE, false, DataRowVersion.Current);
                        obj.Town        = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.TOWN, false, DataRowVersion.Current);
                        obj.Country     = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.COUNTRY, false, DataRowVersion.Current);
                        obj.Vat         = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.VAT, false, DataRowVersion.Current);
                        obj.Phone       = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.PHONE, false, DataRowVersion.Current);
                        obj.Language    = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.LANGUAGE, false, DataRowVersion.Current);
                        obj.Currency    = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.CURRENCY, false, DataRowVersion.Current);
                        obj.Email       = RowFunctions.GetValueFromRowToString(supplier, SupplierObject.EMAIL, false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #11
0
        public static EmployeeObject EmployeeRowToObject(DataRow employee, string alias)
        {
            EmployeeObject obj = new EmployeeObject();

            try
            {
                if (employee != null)
                {
                    string aliasLanguage = "";
                    if (alias != "")
                    {
                        aliasLanguage = alias + "Language";
                    }
                    string test = EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias);
                    if (RowFunctions.GetValueFromRowToGuid(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias), false, DataRowVersion.Current) != Guid.Empty)
                    {
                        obj.EmpID          = RowFunctions.GetValueFromRowToGuid(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMP_ID, alias), true, DataRowVersion.Current);
                        obj.TranscID       = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSC_ID, alias), true, DataRowVersion.Current);
                        obj.TransiID       = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSI_ID, alias), false, DataRowVersion.Current);
                        obj.Name           = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.NAME, alias), false, DataRowVersion.Current);
                        obj.Surname        = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.SURNAME, alias), false, DataRowVersion.Current);
                        obj.Email          = RowFunctions.GetValueFromRowToString(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.EMAIL, alias), false, DataRowVersion.Current);
                        obj.Archive        = RowFunctions.GetValueFromRowToBoolean(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.ARCHIVE, alias), false, DataRowVersion.Current);
                        obj.TranscLanguage = RowFunctions.GetValueFromRowToInteger(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.TRANSC_LANGUAGE, alias), false, DataRowVersion.Current);
                        obj.Language       = LanguageConvertor.LanguageRowToObject(employee, aliasLanguage);
                        obj.RepeatMail     = RowFunctions.GetValueFromRowToBoolean(employee, EmployeeObject.ConvertColumnToAlias(EmployeeObject.REPEAT_MAIL, alias), false, DataRowVersion.Current);
                    }
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #12
0
        public static PopupObject PopupRowToObject(DataRow popup)
        {
            PopupObject obj = new PopupObject();

            try
            {
                if (popup != null)
                {
                    obj.PopupID      = RowFunctions.GetValueFromRowToGuid(popup, PopupObject.POPUP_ID, true, DataRowVersion.Current);
                    obj.Description  = RowFunctions.GetValueFromRowToString(popup, PopupObject.DESCRIPTION, true, DataRowVersion.Current);
                    obj.Repeation    = (Framework.Common.Enumeration.Frequency.TimeFrequency)RowFunctions.GetValueFromRowToInteger(popup, PopupObject.REPEAT, true, DataRowVersion.Current);
                    obj.Time         = RowFunctions.GetValueFromRowToString(popup, PopupObject.TIME, true, DataRowVersion.Current);
                    obj.Active       = RowFunctions.GetValueFromRowToBoolean(popup, PopupObject.ACTIVE, true, DataRowVersion.Current);
                    obj.CreationDate = RowFunctions.GetValueFromRowToString(popup, PopupObject.CREATIONDATE, true, DataRowVersion.Current);
                    obj.ShowDirect   = RowFunctions.GetValueFromRowToBoolean(popup, PopupObject.SHOW_DIRECT, true, DataRowVersion.Current);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
예제 #13
0
        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);
        }