Ejemplo n.º 1
0
        public void Load(int IdUsuario, TextBox txtoldPassword)
        {
            try
            {
                ContraseñaTextbox = txtoldPassword;
                idusuario         = IdUsuario;
                UserDataSet dataset = new UserDataSet();
                UserDataSetTableAdapters.System_UsersTableAdapter TableUser = new UserDataSetTableAdapters.System_UsersTableAdapter();
                UserDataSet.System_UsersDataTable dataTable = TableUser.GetDataUserById(IdUsuario);

                if (dataTable.Rows.Count > 0)
                {
                    UserDataSetTableAdapters.System_Users_ObsTableAdapter User_obs = new UserDataSetTableAdapters.System_Users_ObsTableAdapter();
                    UserDataSet.System_Users_ObsDataTable dataTable_Obs            = User_obs.GetDataUser_ObsById(IdUsuario);

                    _row = (UserDataSet.System_UsersRow)dataTable.Rows[0];

                    RaisePropertyChanged(nameof(Name));
                    RaisePropertyChanged(nameof(Phone));
                    RaisePropertyChanged(nameof(FullName));
                    RaisePropertyChanged(nameof(Email));
                    RaisePropertyChanged(nameof(Enabled));

                    _row_obs = (UserDataSet.System_Users_ObsRow)dataTable_Obs.Rows[0];
                    RaisePropertyChanged(nameof(Observations));
                }
                FormLoadFinished?.Invoke();
            }
            catch (Exception e)
            {
                FormLoadError?.Invoke(e);
            }
        }
Ejemplo n.º 2
0
        public void Load(long id)
        {
            try
            {
                AssignmentsDataSet ds = new AssignmentsDataSet();
                AssignmentsDataSetTableAdapters.AssignmentsTableAdapter adapter = new AssignmentsDataSetTableAdapters.AssignmentsTableAdapter();
                AssignmentsDataSet.AssignmentsDataTable dataTable = adapter.GetDataById(id);

                if (dataTable.Rows.Count > 0)
                {
                    _row = (AssignmentsDataSet.AssignmentsRow)dataTable.Rows[0];

                    RaisePropertyChanged(nameof(Date));
                    RaisePropertyChanged(nameof(Observations));
                    RaisePropertyChanged(nameof(Enabled));
                    UpdateDriverInfo(_row.DriverId);
                    UpdateCabInfo(_row.CabId);
                    UpdateTrailerInfo(_row.TrailerId);
                }


                FormLoadFinished?.Invoke();
            }
            catch (Exception e)
            {
                FormLoadError?.Invoke(e);
            }
        }
Ejemplo n.º 3
0
        public void Load(int IdProduct)
        {
            try
            {
                ProductDataSet dataset = new ProductDataSet();
                ProductDataSetTableAdapters.ProductsTableAdapter TableProduct = new ProductDataSetTableAdapters.ProductsTableAdapter();
                ProductDataSet.ProductsDataTable dataTable = TableProduct.GetDataProductById(IdProduct);


                if (dataTable.Rows.Count > 0)
                {
                    ProductDataSetTableAdapters.Products_ObsTableAdapter Product_obs = new ProductDataSetTableAdapters.Products_ObsTableAdapter();
                    ProductDataSet.Products_ObsDataTable dataTable_Obs = Product_obs.GetDataProductr_ObsById(IdProduct);

                    _row = (ProductDataSet.ProductsRow)dataTable.Rows[0];

                    RaisePropertyChanged(nameof(Name));
                    RaisePropertyChanged(nameof(Code));
                    RaisePropertyChanged(nameof(Density));
                    RaisePropertyChanged(nameof(MeasureUnit));
                    RaisePropertyChanged(nameof(Enabled));

                    _row_obs = (ProductDataSet.Products_ObsRow)dataTable_Obs.Rows[0];
                    RaisePropertyChanged(nameof(Observations));
                }
                FormLoadFinished?.Invoke();
            }
            catch (Exception e)
            {
                FormLoadError?.Invoke(e);
            }
        }
Ejemplo n.º 4
0
        public void Load(int IdColor, TextBox textboxFactoryColor, TextBox textboxClientColor, TextBox textboxUrgentColor, TextBox textboxFinalDayColor, TextBox textboxPreferenceColor, TextBox textboxTheLastPreferent, ColorPicker ClrPcker_Background, ColorPicker ClrPcker_Background1, ColorPicker ClrPcker_Background2, ColorPicker ClrPcker_Background3, ColorPicker ClrPcker_Background4, ColorPicker ClrPcker_Background5)
        {
            AssignTextBox(textboxFactoryColor, textboxClientColor, textboxUrgentColor, textboxFinalDayColor, textboxPreferenceColor, textboxTheLastPreferent);

            try
            {
                ColorDataSet dataset = new ColorDataSet();
                ColorDataSetTableAdapters.Factories_ColorsTableAdapter TableFactoriesColors = new ColorDataSetTableAdapters.Factories_ColorsTableAdapter();
                ColorDataSet.Factories_ColorsDataTable dataTable = TableFactoriesColors.GetDataColorsById(IdColor);


                if (dataTable.Rows.Count > 0)
                {
                    ColorDataSetTableAdapters.FactoriesTableAdapter factoryname = new ColorDataSetTableAdapters.FactoriesTableAdapter();
                    ColorDataSet.FactoriesDataTable dataTable_name = factoryname.GetDataById(IdColor);


                    _row = (ColorDataSet.Factories_ColorsRow)dataTable.Rows[0];

                    RaisePropertyChanged(nameof(ClientColor));
                    RaisePropertyChanged(nameof(FactoryColor));
                    RaisePropertyChanged(nameof(PreferenceColor));
                    RaisePropertyChanged(nameof(UrgentColor));
                    RaisePropertyChanged(nameof(FinalDayColor));
                    RaisePropertyChanged(nameof(TheLastPreferent));

                    //incializamos las barras con el color
                    textboxFactoryColor.Background     = (SolidColorBrush)(new BrushConverter().ConvertFrom(_row.FactoryColor.ToString().Trim()));
                    textboxClientColor.Background      = (SolidColorBrush)(new BrushConverter().ConvertFrom(_row.ClientColor.ToString().Trim()));
                    textboxUrgentColor.Background      = (SolidColorBrush)(new BrushConverter().ConvertFrom(_row.UrgentColor.ToString().Trim()));
                    textboxFinalDayColor.Background    = (SolidColorBrush)(new BrushConverter().ConvertFrom(_row.FinalDayColor.ToString().Trim()));
                    textboxPreferenceColor.Background  = (SolidColorBrush)(new BrushConverter().ConvertFrom(_row.PreferenceColor.ToString().Trim()));
                    textboxTheLastPreferent.Background = (SolidColorBrush)(new BrushConverter().ConvertFrom(_row.TheLastPreferent.ToString().Trim()));

                    _rowName = (ColorDataSet.FactoriesRow)dataTable_name.Rows[0];
                    _rowCode = (ColorDataSet.FactoriesRow)dataTable_name.Rows[0];
                    RaisePropertyChanged(nameof(Name));
                    RaisePropertyChanged(nameof(Code));
                }
                FormLoadFinished?.Invoke();
            }
            catch (Exception e)
            {
                FormLoadError?.Invoke(e);
            }
        }
Ejemplo n.º 5
0
        public void Load(long IdOrder)
        {
            try
            {
                OrderDataSet dataset = new OrderDataSet();
                OrderDataSetTableAdapters.OrdersTableAdapter TableOrder = new OrderDataSetTableAdapters.OrdersTableAdapter();
                OrderDataSet.OrdersDataTable dataTable = TableOrder.GetDataOrderById(IdOrder);

                if (dataTable.Rows.Count > 0)
                {
                    OrderDataSetTableAdapters.Orders_ObsTableAdapter order_obs = new OrderDataSetTableAdapters.Orders_ObsTableAdapter();
                    OrderDataSet.Orders_ObsDataTable dataTable_Obs             = order_obs.GetDataOrder_ObsById(IdOrder);

                    _row = (OrderDataSet.OrdersRow)dataTable.Rows[0];

                    RaisePropertyChanged(nameof(Reference));
                    RaisePropertyChanged(nameof(OperatorCode));
                    RaisePropertyChanged(nameof(ClientCode));
                    RaisePropertyChanged(nameof(ProductCode));
                    RaisePropertyChanged(nameof(FactoryCode));
                    RaisePropertyChanged(nameof(ClientId));
                    RaisePropertyChanged(nameof(Address));
                    RaisePropertyChanged(nameof(City));
                    RaisePropertyChanged(nameof(PostCode));
                    RaisePropertyChanged(nameof(FromDate));
                    RaisePropertyChanged(nameof(ToDate));
                    RaisePropertyChanged(nameof(ProductId));
                    RaisePropertyChanged(nameof(VehicleSize));
                    RaisePropertyChanged(nameof(RequestedAmount));
                    RaisePropertyChanged(nameof(Status));

                    //Cargamos datos
                    LoadDatasInterface(_row.ProductId, _row.OperatorId, _row.ClientId, _row.FactoryId);

                    _row_obs = (OrderDataSet.Orders_ObsRow)dataTable_Obs.Rows[0];
                    RaisePropertyChanged(nameof(Description));
                    RaisePropertyChanged(nameof(Observation));
                }
                FormLoadFinished?.Invoke();
            }
            catch (Exception e)
            {
                FormLoadError?.Invoke(e);
            }
        }