Beispiel #1
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 SupplierObject GetSupplierByEmail(string email)
        {
            SupplierObject supplier = new SupplierObject();
            QueryBuilder   builder;

            try
            {
                builder = new QueryBuilder();
                builder.Append(this.BaseQuery(false, 0));
                builder.AppendWhereString(SupplierObject.EMAIL, email, QueryBuilder.ComparisonOperators.Equal, QueryBuilder.ParameterLocation.FIRST_LAST);

                DataSet result = this.ExecuteDataSet(builder.Query, false);
                if (result.Tables[0].Rows.Count > 0)
                {
                    supplier = SupplierConvertor.SupplierRowToObject(result.Tables[0].Rows[0]);
                }
                else
                {
                    return(null);
                }
            }
            catch (System.Exception exception1)
            {
                throw new Exception(MethodBase.GetCurrentMethod().Name, exception1);
            }
            return(supplier);
        }
        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);
        }
        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);
        }