예제 #1
0
        private void CmdAddItem_Click(object sender, EventArgs e)
        {
            bool booAgregarUnidad = true;

            if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 1)) == "")
            {
                booAgregarUnidad = false;
            }
            if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 2)) == "")
            {
                booAgregarUnidad = false;
            }
            if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 3)) == "")
            {
                booAgregarUnidad = false;
            }
            if (Convert.ToString(FgItems.GetData(FgItems.Rows.Count - 1, 4)) == "")
            {
                booAgregarUnidad = false;
            }


            if (booAgregarUnidad == true)
            {
                FgItems.Rows.Count = FgItems.Rows.Count + 1;
                //FgItems.Cols[5].DataType = typeof(bool);
                //FgItems.SetData(FgItems.Rows.Count - 1, 5, false);
                FgItems.Focus();
            }
            else
            {
                MessageBox.Show("No puede agregar mas items hasta que no haya completado el item anterior", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            }
        }
예제 #2
0
        private void FrmCerrarModulo_Activated(object sender, EventArgs e)
        {
            if (booSeEjecuto == false)
            {
                booSeEjecuto            = true;
                booAgregando            = true;
                CboModulo.SelectedValue = 0;
                booAgregando            = false;
                ListarEstado();

                if (dtLista.Rows.Count == 0)
                {
                    DialogResult Rpta = MessageBox.Show("No se han encontrado registros, ¿ Desea agregar uno ahora ?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);

                    if (DialogResult.Yes == Rpta)
                    {
                        // Nuevo();
                    }
                    else
                    {
                        this.Close();
                    }
                }
                else
                {
                    FgItems.Focus();
                }
            }
        }
예제 #3
0
 private void CmdDelItem_Click(object sender, EventArgs e)
 {
     if (FgItems.Rows.Count > 2)
     {
         FgItems.RemoveItem(FgItems.Row);
         FgItems.Focus();
     }
 }
예제 #4
0
 void Nuevo()
 {
     n_QueHace = 1;
     Tab1.TabPages[0].Enabled = false;
     Blanquea();
     Bloquea();
     ActivarTool();
     LblTitulo2.Text           = "Agregando Nuevo Registro";
     Tab1.SelectedIndex        = 1;
     FgItems.Cols[2].ComboList = "...";
     FgItems.Focus();
 }
예제 #5
0
        void Modificar()
        {
            int n_despachado  = Convert.ToInt32(DgLista.Columns["n_des"].CellValue(DgLista.Row).ToString());
            int intIdRegistro = Convert.ToInt32(DgLista.Columns["n_id"].CellValue(DgLista.Row).ToString());

            if (n_despachado == 1)
            {
                MessageBox.Show("No se puede modificar un pedido despachado", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                return;
            }

            n_QueHace = 2;
            Tab1.TabPages[0].Enabled = false;
            Blanquea();
            Bloquea();
            ActivarTool();

            VerRegistro(intIdRegistro);
            LblTitulo2.Text    = "Modificando Registro";
            Tab1.SelectedIndex = 1;
            FgItems.Focus();
        }
예제 #6
0
        bool CamposOK()
        {
            bool booEstado = true;

            if (TxtProv.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el proveedor del documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtProv.Focus();
                return(booEstado);
            }
            if (Convert.ToInt32(CboTipDoc.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado el tipo de documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboTipDoc.Focus();
                return(booEstado);
            }
            if (TxtNumSer.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el numero de serie !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtNumSer.Focus();
                return(booEstado);
            }
            if (TxtNumDoc.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el numero de documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtNumDoc.Focus();
                return(booEstado);
            }
            if (Convert.ToInt32(CboConPag.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la condicion de pago del documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboConPag.Focus();
                return(booEstado);
            }
            if (TxtFchVen.Text == "")
            {
                MessageBox.Show("¡ No ha especificado la fecha de vencimiento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtFchVen.Focus();
                return(booEstado);
            }
            if (TxtImponible.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el detalle del documento !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                FgItems.Focus();
                return(booEstado);
            }
            if (TxtTipCam.Text == "")
            {
                MessageBox.Show("¡ No ha especificado el tipo de cambio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtTipCam.Focus();
                return(booEstado);
            }
            if (TxtImpTot.Text == "")
            {
                MessageBox.Show("¡ El importe total del documento no puede ser 0 !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtTipCam.Focus();
                return(booEstado);
            }

            return(booEstado);
        }