Exemple #1
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);
        }
Exemple #2
0
        public static TaskPeopleObject TaskPeopleRowToObject(DataRow taskPeople)
        {
            TaskPeopleObject obj = new TaskPeopleObject();

            try
            {
                if (taskPeople != null)
                {
                    obj.TpeopID  = RowFunctions.GetValueFromRowToGuid(taskPeople, TaskPeopleObject.TPEOP_ID, true, DataRowVersion.Current);
                    obj.Employee = EmployeeConvertor.EmployeeRowToObject(taskPeople, EmployeeObject.TABLE);
                    obj.Supplier = SupplierConvertor.SupplierRowToObject(taskPeople);
                    obj.Customer = CustomerConvertor.CustomerRowToObject(taskPeople);
                    obj.Unknown  = UnknownConvertor.UnknownRowToObject(taskPeople);
                    obj.Assignee = RowFunctions.GetValueFromRowToBoolean(taskPeople, TaskPeopleObject.ASSIGNEE, true, DataRowVersion.Current);
                    obj.Reporter = RowFunctions.GetValueFromRowToBoolean(taskPeople, TaskPeopleObject.REPORTER, true, DataRowVersion.Current);
                    obj.Task     = TaskConvertor.TaskRowToObject(taskPeople);
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
        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);
        }
        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);
        }
Exemple #5
0
        public static UserObject UserRowToObject(DataRow user)
        {
            UserObject obj = new UserObject();

            try
            {
                if (user != null)
                {
                    obj.UsrID     = RowFunctions.GetValueFromRowToGuid(user, UserObject.USR_ID, true, DataRowVersion.Current);
                    obj.Employee  = Employee.EmployeeConvertor.EmployeeRowToObject(user, "");
                    obj.Surname   = RowFunctions.GetValueFromRowToString(user, UserObject.SURNAME, false, DataRowVersion.Current);
                    obj.Name      = RowFunctions.GetValueFromRowToString(user, UserObject.NAME, false, DataRowVersion.Current);
                    obj.Login     = RowFunctions.GetValueFromRowToString(user, UserObject.LOGIN, true, DataRowVersion.Current);
                    obj.Password  = RowFunctions.GetValueFromRowToString(user, UserObject.PASSWORD, true, DataRowVersion.Current);
                    obj.Active    = RowFunctions.GetValueFromRowToBoolean(user, UserObject.ACTIVE, true, DataRowVersion.Current);
                    obj.HasPopups = RowFunctions.GetValueFromRowToBoolean(user, UserObject.HASPOPUPS, false, DataRowVersion.Current);
                    obj.Security  = UserSecurityConvertor.UserSecurityRowToObject(user);
                    obj.SetInitialValues();
                    return(obj);
                }
                obj = null;
            }
            catch (System.Exception exception1)
            {
                Exception innerException = exception1;
                throw new Exception(MethodBase.GetCurrentMethod().Name, innerException);
            }
            return(obj);
        }
Exemple #6
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);
        }
        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);
        }
Exemple #8
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);
        }