Exemplo n.º 1
0
        public void AddNotaDePeso_Click(string Detalles)
        {
            try
            {
                decimal NOTA_PORCENTAJEHUMEDADMIN = Convert.ToDecimal(this.Variables["NOTA_PORCENTAJEHUMEDADMIN"]);
                decimal NOTA_TRANSPORTECOOP = Convert.ToDecimal(this.Variables["NOTA_TRANSPORTECOOP"]);

                string loggedUser = this.LoggedUserHdn.Text;

                var detalles = JSON.Deserialize<Dictionary<string, string>[]>(Detalles);

                NotaDePesoLogic notadepesologic = new NotaDePesoLogic();


                string pDefecto = this.AddPorcentajeDefectoTxt.Text.Replace("%", "");
                string pHumedad = this.AddPorcentajeHumedadTxt.Text.Replace("%", "");

                notadepesologic.InsertarNotaDePeso
                    (Convert.ToInt32(this.AddEstadoNotaCmb.Text),
                    this.AddSociosIdTxt.Text,
                    Convert.ToInt32(this.AddClasificacionCafeCmb.Text),
                    this.AddFechaNotaTxt.SelectedDate,
                    this.AddCooperativaRadio.Value == null ? false : Convert.ToBoolean(this.AddCooperativaRadio.Value),
                    Convert.ToDecimal(pDefecto),
                    Convert.ToDecimal(pHumedad),
                    Convert.ToDecimal(this.AddSumaPesoBrutoTxt.Text),
                    Convert.ToDecimal(this.AddTaraTxt.Text),
                    Convert.ToInt32(this.AddSacosRetenidosTxt.Text),
                    loggedUser,
                    detalles,
                    NOTA_PORCENTAJEHUMEDADMIN,
                    NOTA_TRANSPORTECOOP);
            }
            catch (Exception ex)
            {
                log.Fatal("Error fatal al agregar nota de peso.", ex);
                throw;
            }
        }