Example #1
0
 public void LoadData()
 {
     using (var datos = new DataAcces())
     {
         Orders = new ObservableCollection <OrderViewModel>(datos.GetList(NewOrder));
     };
     using (var datos = new DataAcces())
     {
         Settings = (SettingsViewModel)(datos.GetTop(Settings));
         if (Settings != null)
         {
             App.Lenguage = Settings.Leguange;
         }
     };
     Companys = new ObservableCollection <CompanyViewModel>();
     CallCompanys();
 }
Example #2
0
        private async void cmd_grabar()
        {
            _entityFrameworkService = new EntityFrameworkService();

            try
            {
                var producto = new Producto();


                producto.prod_codi   = textcodigo.Text;
                producto.prod_descr  = textnombre.Text;
                producto.prod_unid   = combounidad.SelectedItem.ToString();
                producto.prod_stock  = textcantidad.Text;
                producto.prod_precio = textprecio.Text;



                textcodigo.Text   = "";
                textnombre.Text   = "";
                textprecio.Text   = "";
                textcantidad.Text = "";

                // _entityFrameworkService.ProductoInse(producto);



                data.Insert <Producto>(producto);

                await   DisplayAlert("System", "Producto agregado con exito", "ok");

                //Alerta.Text = "Producto agregado con exito";
                var result = data.GetList <Producto>(false);
            }
            catch (Exception ex)
            {
                await  DisplayAlert("System", ex.Message, "ok");
            }
        }
Example #3
0
        private async void cmd_grabar()
        {
            _entityFrameworkService = new EntityFrameworkService();
            DataAcces data = new DataAcces();

            try
            {
                var cliente = new Cliente();


                cliente.tipodocu  = combotipodocu.SelectedItem.ToString();
                cliente.nombres   = textnombre.Text;
                cliente.documento = textdocu.Text;
                cliente.direccion = textdireccion.Text;
                cliente.email     = textemail.Text;
                cliente.celular   = textcelular.Text;

                textdireccion.Text = "";
                textnombre.Text    = "";
                textdocu.Text      = "";
                textemail.Text     = "";
                textcelular.Text   = "";

                // _entityFrameworkService.ClienteInse(cliente);

                data.Insert <Cliente>(cliente);

                await DisplayAlert("System", "Cliente agregado con exito", "ok");

                //Alerta.Text = "Producto agregado con exito";
                var result = data.GetList <Cliente>(false);
            }
            catch (Exception ex)
            {
                await DisplayAlert("System", ex.Message, "ok");
            }
        }