Exemple #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(this.IpLocal))
                {
                    this.IpLocal = DireccionIP.Local();
                }

                if (string.IsNullOrEmpty(this.IpPublica))
                {
                    this.IpPublica = DireccionIP.Publica();
                }

                if (string.IsNullOrEmpty(this.SerialHDD))
                {
                    this.SerialHDD = DireccionIP.SerialNumberDisk();
                }

                if (string.IsNullOrEmpty(this.Usuario))
                {
                    this.Usuario = DireccionIP.SerialNumberDisk();
                }

                bool indicateSave = false;
                foreach (DataGridViewRow row in dataGridView3.Rows)
                {
                    if (Convert.ToBoolean(row.Cells[0].Value))
                    {
                        break;
                    }
                }
                GuardarDatos   Guardar  = new GuardarDatos();
                SqlParameter[] ParamSQl = GuardarDatos.Parametros_OrdenesMuestreoPM("", cmbShipment.Text, dtpEvent.Value, !String.IsNullOrEmpty(/*label4.Text*/ string.Empty) ? int.Parse(/*label4.Text*/ string.Empty) : 0, cbmLabo.SelectedIndex, (true /*rbtAnalisys.Checked*/) ? /*rbtAnalisys.Checked */ true: false, 1);

                if (ParamSQl[0].Value.ToString() == "I")
                {
                    Guardar.Numerico("Sp_Guardar_OrdenMuestraPM", ParamSQl).ToString();

                    MessageBox.Show("Muestreo almacenado con Exito");
                    loadHistory();
                    //LlenarLog.Registro(DateTime.Now, this.Usuario, this.IpLocal, this.IpPublica, this.SerialHDD, Environment.MachineName, "Se creo Registro de Muestreo " + TxbConsecutivo.Text.Trim(), "Movimiento Muestreo creado");
                    //Limpiar(1);
                }
                else
                {
                    MessageBox.Show("Personal de Muestreo actualizado con Exito");
                    //LlenarLog.Registro(DateTime.Now, this.Usuario, this.IpLocal, this.IpPublica, this.SerialHDD, Environment.MachineName, "Se modifico Personal de Muestreo " + TxbConsecutivo.Text.Trim(), "Movimiento Muestreo  Modificar");
                }
            }
            catch (Exception Ex)
            {
                MessageBox.Show(Ex.Message);
            }
        }