Beispiel #1
0
        public async Task <ActionResult> Update([FromBody] Datepicker datepicker)
        {
            try
            {
                var datepickerDto = _mapper.Map <DatepickerDto>(datepicker);
                await _datepickerLogic.Update(datepickerDto);

                return(Ok());
            }
            catch (KeyNotFoundException)
            {
                return(NotFound());
            }
            catch (UnprocessableException)
            {
                return(StatusCode(StatusCodes.Status422UnprocessableEntity));
            }
            catch (DuplicateNameException)
            {
                return(StatusCode(StatusCodes.Status409Conflict));
            }
            catch (Exception e)
            {
                _logLogic.Log(e);
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
        async void SaveTool()
        {
            var fecha = Datepicker.ToString("dd/MM/yyyy");

            await Application.Current.MainPage.DisplayAlert(
                "Hola",
                fecha + " " + Responsable + " " + MariolaAlzas + " " + SoncuanoAlzas + " " + TotalAlzas + " " + MariolaKg + " " + SoncuanoKg + " " + TotalKg + " " + PrecioCompra + " " +
                TotalPagar + " " + Comentario,
                "Aceptar");
        }
        private void RegistrationForm_Load(object sender, EventArgs e)
        {
            ds = new DataSet();
            ds.ReadXml(Application.StartupPath + "\\users.xml");
            dt = ds.Tables["users"];

            if (radioBtnEleve.Checked == true)
            {
                Datepicker.Show();
            }
            else
            {
                Datepicker.Hide();
            }
        }
Beispiel #4
0
        public async Task <ActionResult> Add([FromBody] Datepicker datepicker)
        {
            try
            {
                var        datepickerDto  = _mapper.Map <DatepickerDto>(datepicker);
                UserHelper requestingUser = _controllerHelper.GetRequestingUser(this);
                await _datepickerLogic.Add(datepickerDto, requestingUser);

                return(Ok());
            }
            catch (DuplicateNameException)
            {
                return(StatusCode(StatusCodes.Status409Conflict));
            }
            catch (Exception e)
            {
                _logLogic.Log(e);
                return(StatusCode(StatusCodes.Status500InternalServerError));
            }
        }
        async void Guardar()
        {
            IsEnabled = false;
            var fecha = Datepicker.ToString("dd/MM/yyyy");

            #region Miranda: Guardar Tabla

            #region Limpiar Cache //borrar los datos existentes en persistencia

            if (Application.Current.Properties.ContainsKey("ContadorMieles"))
            {
                Elementos = int.Parse((Application.Current.Properties["ContadorMieles"]) as string);
            }
            else
            {
                Elementos = 0;
            }
            for (int j = 0; j < Elementos; j++) //Elementos va a representar el total de elementos o filas existentes en mi persistencia
            {
                if (Application.Current.Properties.ContainsKey("Lote" + j))
                {
                    Application.Current.Properties.Remove("Lote" + j);
                }
                if (Application.Current.Properties.ContainsKey("Especie" + j))
                {
                    Application.Current.Properties.Remove("Especie" + j);
                }
                if (Application.Current.Properties.ContainsKey("Alza" + j))
                {
                    Application.Current.Properties.Remove("Alza" + j);
                }
                if (Application.Current.Properties.ContainsKey("Peso"))
                {
                    Application.Current.Properties.Remove("Peso");
                }
            }

            #endregion

            #region Ciclo para Guardar en Persistencia
            i = 0; //inicio el contador de mis elementos o filas en (0)
            foreach (var miel in Mieles)
            {
                Application.Current.Properties["Lote" + i]    = miel.Lote.ToString();
                Application.Current.Properties["Especie" + i] = miel.Especie.ToString();
                Application.Current.Properties["Alza" + i]    = miel.Alza.ToString();
                Application.Current.Properties["Peso" + i]    = miel.Peso.ToString();
                i++;
                Application.Current.Properties["ContadorMieles"] = i.ToString();
                await Application.Current.SavePropertiesAsync();
            }

            #endregion

            int filas;
            HeighListView = 44 * i;
            if (Application.Current.Properties.ContainsKey("ContadorMieles"))
            {
                filas = int.Parse(Application.Current.Properties["ContadorMieles"] as string);
            }
            else
            {
                filas = 0;
            }
            filas = Mieles.Count;
            await Application.Current.MainPage.DisplayAlert("Notificación", "El Numero de Lotes Guardados es: " + filas.ToString(), "Excelente");

            #endregion


            await Application.Current.MainPage.DisplayAlert(
                "Hola",
                fecha + " " + Responsable + " " + MariolaAlzas + " " + SoncuanoAlzas + " " + TotalAlzas + " " + MariolaKg + " " + SoncuanoKg + " " + TotalKg + " " + PrecioCompra + " " +
                TotalPagar + " " + Comentario,
                "Aceptar");

            IsEnabled = true;
        }