Exemple #1
0
 public int usp_InsTicketPesada(int TipoOperacion, TICKET_PESADA oTP)
 {
     using (var db = new ApplicationDbContextSGO())
     {
         var response = db.usp_InsTicketPesada(TipoOperacion, oTP.IdTicketPesada, oTP.Cosecha, oTP.IdCliente, oTP.IdContactoCliente, oTP.IdLocal,
                                               oTP.FechaTicket.ToString(), oTP.IdLaboratorio, oTP.NroSaco, oTP.IdSaco, oTP.PesoSaco, oTP.Tara, oTP.KgBruto, oTP.KgNeto, oTP.DsctoAgua, oTP.KgSeco,
                                               oTP.IdProceso, oTP.Observaciones, oTP.IdEstado, oTP.UsuarioRegistro, oTP.IdTipoCafe, oTP.IdGuiaRemision, oTP.GuiaRemision);
         return(response);
         //return null;
     }
 }
Exemple #2
0
        public int usp_InsTicketPesada(int TipoOperacion, TICKET_PESADA oBe)
        {
            int inResponse = 0;

            try
            {
                inResponse = iSTicketPesada.usp_InsTicketPesada(TipoOperacion, oBe);
            }
            catch (Exception ex)
            {
                iLogService.SetLog(string.Concat("WPF => usp_LisTicketPesada | ", ex.Message, " | ", ex.Source.ToString(), " | ", ex.StackTrace.ToString()), null);
            }
            return(inResponse);
        }
Exemple #3
0
        private async void btnGrabar_Click(object sender, RoutedEventArgs e)
        {
            if (!ValidarVacios())
            {
                MessageBox.Show("Ingresar los datos en los elementos resaltados");
                return;
            }
            int    IdTicket          = Convert.ToInt32(lblIdTicket.Content);
            int    Cosecha           = Convert.ToInt32(cboCosecha.Text);
            int    IdCliente         = Convert.ToInt32(lblIdCliente.Content);
            int    IdContactoCliente = Convert.ToInt32(cboProveedor.SelectedValue);
            string IdLocal           = cboOfOperacion.SelectedValue.ToString();
            string FechaTicket       = dtFecha.Text;

            string[] arrAnalisis;
            string   IdLaboratorio = "";

            if (strGestion == "Nuevo")
            {
                arrAnalisis   = cboAnalisis.SelectedValue.ToString().Split('*');
                IdLaboratorio = arrAnalisis[arrAnalisis.Length - 1];
            }
            else if (strGestion == "Editar")
            {
                IdLaboratorio = Convert.ToInt32(lblidLaboratorio.Content.ToString()).ToString(); /*0000012123 => 12123*/
            }

            int NroSaco = Convert.ToInt32(txtNroSacos.Text);

            string[] arrTipoSaco = cboTipoSaco.SelectedValue.ToString().Split('|');
            int      IdSaco      = Convert.ToInt32(arrTipoSaco[0]);
            decimal  PesoSaco    = Convert.ToDecimal(txtPesoRef.Text);
            decimal  Tara        = Convert.ToDecimal(txtTara.Text);
            decimal  KgBruto     = Convert.ToDecimal(txtKgBruto.Text);
            decimal  KgNeto      = Convert.ToDecimal(txtKgNeto.Text);
            decimal  DsctoAgua   = Convert.ToDecimal(0);
            decimal  KgSeco      = Convert.ToDecimal(lblKgSeco.Content.ToString());
            string   IdProceso   = "0";
            string   Observacion = txtObservaciones.Text;
            string   IdEstado    = chkEstadoTicket.IsChecked == true ? "1" : "0";
            /*♦ IdEstado==0 => en el usp set idLaboratorio=0*/
            int    IdTipoCafe     = Convert.ToInt32(cboTipoProducto.SelectedValue);
            string IdGuiaRemision = "";
            string GuiaRemision   = "";

            string data          = "";
            int    tipoOperacion = 0;

            string oResultado = "0";


            if (IdTicket.ToString().Equals("0"))
            {
                tipoOperacion = Convert.ToInt32(Util.TipoOperacion.Insertar);
            }
            else
            {
                tipoOperacion = Convert.ToInt32(Util.TipoOperacion.Modificar);
            }
            var oTicket = new TICKET_PESADA()
            {
                Cosecha           = Cosecha,
                IdTicketPesada    = IdTicket,
                IdCliente         = IdCliente,
                IdContactoCliente = IdContactoCliente,
                IdLocal           = IdLocal,
                FechaTicket       = Convert.ToDateTime(FechaTicket),
                IdLaboratorio     = Convert.ToInt32(IdLaboratorio),
                NroSaco           = NroSaco,
                IdSaco            = IdSaco,
                PesoSaco          = PesoSaco,
                Tara            = Tara,
                KgBruto         = KgBruto,
                KgNeto          = KgNeto,
                DsctoAgua       = DsctoAgua,
                KgSeco          = KgSeco,
                IdProceso       = Convert.ToInt32(IdProceso),
                Observaciones   = Observacion,
                IdEstado        = Convert.ToInt32(IdEstado),
                UsuarioRegistro = ((Usuario)Application.Current.Resources["UserData"]).IdUsuario.ToString(),
                IdTipoCafe      = IdTipoCafe,
                IdGuiaRemision  = IdGuiaRemision,
                GuiaRemision    = GuiaRemision
            };



            try
            {
                //oResultado = oBl.usp_InsTicketPesada(oBe);


                var oSResultado = _ticketPesadaClient.usp_InsTicketPesada(tipoOperacion, oTicket);
                oResultado = "1";
            }
            catch (Exception ex)
            {
                /*¡LOG!*/
            }

            if (oResultado == "1")
            {
                data = "Operacion realizada correctamente";
                //btnImprimir.Visibility = Visibility.Visible;
            }
            else
            {
                data = "Fail";
                //btnImprimir.Visibility = Visibility.Hidden;
            }



            MessageBox.Show(data);
        }
Exemple #4
0
 public int usp_InsTicketPesada(int TipoOperacion, TICKET_PESADA oBe)
 {
     return(iRTicketPesada.usp_InsTicketPesada(TipoOperacion, oBe));
 }