private async void cargar_prestashop() { var metroWindow = this; metroWindow.MetroDialogOptions.ColorScheme = MetroDialogOptions.ColorScheme; ProgressDialogController ProgressAlert = null; LeerPedidos carga_data = null; try { dg1.Columns[13].Visibility = Visibility.Collapsed; carga_data = new LeerPedidos(); ProgressAlert = await this.ShowProgressAsync(Ent_Msg.msgcargando, "Espere un momento por favor, cargando pedidos"); //show message ProgressAlert.SetIndeterminate(); string _cargar_data = await Task.Run(() => (Ent_Global._err_con_mysql)?"" : carga_data.ImportaDataPrestaShop()); if (_cargar_data.Length == 0) { //await Task.Run(() => refrescagrilla_prestashop()); dt = await Task.Run(() => Dat_Liquidacion.liquidacionXfacturar()); await ProgressAlert.CloseAsync(); dg1.AutoGenerateColumns = false; dg1.ItemsSource = dt.DefaultView; totales(dt); } else { dt = await Task.Run(() => Dat_Liquidacion.liquidacionXfacturar()); //await ProgressAlert.CloseAsync(); dg1.AutoGenerateColumns = false; dg1.ItemsSource = dt.DefaultView; totales(dt); await ProgressAlert.CloseAsync(); await metroWindow.ShowMessageAsync(Ent_Msg.msginfomacion, "ERROR EN LA IMPORTACION DE DATOS.. POR FAVOR CONSULTE CON SISTEMAS..==>> TIPO DE ERROR (" + _cargar_data + ")", MessageDialogStyle.Affirmative, metroWindow.MetroDialogOptions); } } catch (Exception exc) { await ProgressAlert.CloseAsync(); await metroWindow.ShowMessageAsync(Ent_Msg.msginfomacion, "ERROR EN LA IMPORTACION DE DATOS.. POR FAVOR CONSULTE CON SISTEMAS..==>> TIPO DE ERROR (" + exc.Message + ")", MessageDialogStyle.Affirmative, metroWindow.MetroDialogOptions); //throw; } }
public async void refrescagrilla_prestashop() { try { //dg1.AutoGenerateColumns = false; dt = await Task.Run(() => Dat_Liquidacion.liquidacionXfacturar()); dg1.ItemsSource = dt.DefaultView; totales(dt); } catch (Exception exc) { } }
public void refrescagrilla() { Mouse.OverrideCursor = Cursors.Wait; try { dg1.AutoGenerateColumns = false; dt = Dat_Liquidacion.liquidacionXfacturar(); dg1.ItemsSource = dt.DefaultView; //modificacion Junior M. para Visualizar las operaciones Gratuitas //fin modificacion Junior //grillaformato(dg1); totales(dt); } catch (Exception exc) { MessageBox.Show(exc.Message, Ent_Msg.msginfomacion, MessageBoxButton.OK, MessageBoxImage.Error); } Mouse.OverrideCursor = null; }