예제 #1
0
        private void btOk_Click(object sender, RoutedEventArgs e)
        {
            ///
            //Item seleccionado
            Transporters transSelected = (Transporters)cbTransport.SelectedItem;

            //
            if (transSelected != null)
            {
                ///
                if (!String.IsNullOrEmpty(txtGuide.Text))
                {
                    ///
                    _transGuidesVM = new Transporters_GuidesViewModel();
                    ///
                    String newIdGuide = "";
                    Liquidacion.insertar_guia(txtGuide.Text, Convert.ToInt32(transSelected._trv_transporters_id), _noLiq, out newIdGuide);
                    ///
                    if (!newIdGuide.Equals("-1") && !newIdGuide.Equals("1"))
                    {
                        //_liqHdrVM = new Liquidation_HdrViewModel();
                        ///// Actualizar el numero de guia en la liquidacion ///
                        //String resp = _liqHdrVM.updateGuideLiquidation( _noLiq, newIdGuide);
                        /////
                        //if (!resp.Equals("-1"))

                        // All process is successfully
                        DialogResult = true;
                        this.Close();
                    }
                    else
                    {
                        txtInfoSave.Foreground = Brushes.Red;
                        ///
                        txtInfoSave.Text = "Es probable que la guia ya exista, por favor dígite un nuevo numero de guia.";
                    }
                }
                else
                {
                    txtInfoSave.Foreground = Brushes.Red;
                    ///
                    txtInfoSave.Text = "Por favor dígite el numero de guia.";
                }
            }
            else
            {
                txtInfoSave.Foreground = Brushes.Red;
                ///
                txtInfoSave.Text = "Por favor, seleccione la transportadora.";
            }
        }