private void ButtonDeleteCoti_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         QuotesServices.DeleteThisQuote(currentItemSelectedCoti);
         cleanSpacesCoti();
         ShowAllQuotes();
         TextBlockMessage.Text = "Eliminado con exito...";
     }
     catch (Exception)
     {
         TextBlockMessage.Text = "No se pudo Elminar...";
     }
 }
        private void fillSpacesQuote()
        {
            DataTable table = QuotesServices.GetThisQuote(currentItemSelectedCoti);

            DatePickerDateCoti.SelectedDate = table.Rows[0]["qu_date"] as DateTime?;
            TextBoxNameCoti.Text            = table.Rows[0]["qu_client_name"].ToString();
            TextBoxPhoneCoti.Text           = table.Rows[0]["qu_phone"].ToString();
            TextBoxDetalle.Text             = table.Rows[0]["qu_detail"].ToString();
            TextBoxPrecioCoti.Text          = table.Rows[0]["qu_price"].ToString();
            TextBoxProveedor.Text           = table.Rows[0]["qu_supplier"].ToString();
            TextBoxNumeroCoti.Text          = table.Rows[0]["qu_quote"].ToString();
            DataTable userData = UsersServices.GetThisUser(table.Rows[0]["qu_user_owner"].ToString());

            TextBoxUsuarioCoti.Text = userData.Rows[0]["us_name"].ToString() + " " + userData.Rows[0]["us_paterno"].ToString() + " " + userData.Rows[0]["us_materno"].ToString();
        }
 private void ButtonAddCoti_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         DateTime?date = new DateTime?();
         date = DatePickerDateCoti.SelectedDate;
         QuotesServices.InsertQuote(date, TextBoxNameCoti.Text, TextBoxPhoneCoti.Text, TextBoxDetalle.Text, TextBoxPrecioCoti.Text, TextBoxProveedor.Text);
         TextBlockMessage.Text = "Guardado con exito...";
         cleanSpacesCoti();
         ShowAllQuotes();
     }
     catch (Exception)
     {
     }
 }
        private void ButtonUpdateCoti_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                DateTime?date = new DateTime?();
                date = DatePickerDateCoti.SelectedDate;


                QuotesServices.UpdateThisQuote(date, TextBoxNameCoti.Text, TextBoxPhoneCoti.Text, TextBoxDetalle.Text, TextBoxPrecioCoti.Text, TextBoxProveedor.Text, currentItemSelectedCoti);
                TextBlockMessage.Text = "Actualizado con exito...";
                cleanSpacesCoti();
                ShowAllQuotes();
            }
            catch (Exception)
            {
                TextBlockMessage.Text = "Ha Ocurrido un error...";
            }
        }
        private void ButtonBuscarCoti_Click(object sender, RoutedEventArgs e)
        {
            DataTable table = QuotesServices.FindThisQuote(TBSClientNameCoti.Text, DPSDateCoti.Text);

            DataGridQuotes.ItemsSource = table.DefaultView;
        }
 private void ShowAllQuotes()
 {
     DataGridQuotes.ItemsSource = QuotesServices.GetAllQuotes().DefaultView;
 }