Beispiel #1
0
        private void miAgregar_Click(object sender, EventArgs e)
        {
            Element el = GGCDetalle.TableControl.Table.CurrentElement;

            LimpiarPanel();
            GPItem.Visible = true;
            if (el != null)
            {
                if (el is GridRecord)
                {
                    DataRowView drv = (el as Record).GetData() as DataRowView;
                    lblItemNIvel1.Text = drv[1].ToString(); //show column 2
                    lblItemNivel2.Text = drv[2].ToString(); //show column 2
                    lblItemNivel3.Text = drv[3].ToString(); //show column 2
                    lblItemNivel4.Text = drv[4].ToString(); //show column 2
                    lblItemNivel5.Text = drv[5].ToString(); //show column 2
                    lblItem.Text       = drv[6].ToString(); //show column 2
                    lblNivel.Text      = drv[8].ToString(); //show column 2
                }
            }
            if (lblNivel.Text.ToString() == "0")
            {
                rbHermano.Enabled = false;
                rbHijo.Checked    = true;
            }
            if (lblNivel.Text.ToString() == "5")
            {
                rbHijo.Enabled    = false;
                rbHermano.Checked = true;
            }
            TxtDesc.Focus();
        }
Beispiel #2
0
 private void limpiar()
 {
     TxtCod.Clear();
     TxtNom.Clear();
     TxtDesc.Clear();
     TxtM1.Clear();
     TxtM2.Clear();
     TxtV1.Clear();
     TxtV2.Clear();
 }
Beispiel #3
0
 private void limpiar()
 {
     TxtCod.Clear();
     TxtNom.Clear();
     TxtDesc.Clear();
     TxtMarca.Clear();
     TxtPrecio_M1.Text = "0";
     TxtPrecio_M2.Text = "0";
     TxtPrecio_V1.Text = "0";
     TxtPrecio_V2.Text = "0";
     Nud.Value         = 0;
 }
 private void Presionar(object sender, KeyEventArgs e)
 {
     ctrl = (Control)sender;
     if (ctrl.Name.Equals("TxtNom") && !Activo)
     {
         Activo = true;
     }
     if (e.Key == Key.Enter)
     {
         if (ctrl.Name.Equals("TxtNom") && !string.IsNullOrEmpty(TxtNom.Text))
         {
             int idExiste = Requisito.ComprobarExistencia(TxtNom.Text);
             if (idExiste != -1)
             {
                 CargarRequisito(idExiste);
             }
             TxtVer.Focus();
         }
         if (ctrl.Name.Equals("TxtVer") && !string.IsNullOrEmpty(TxtVer.Text))
         {
             if (ClsFunciones.TryConvertToDouble(TxtVer.Text))
             {
                 TxtFec.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEVer);
             }
         }
         if (ctrl.Name.Equals("TxtFec") && !string.IsNullOrEmpty(TxtFec.Text))
         {
             if (ClsFunciones.TryConvertToDate(TxtFec.Text))
             {
                 TxtDesc.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEFec);
             }
         }
         if (ctrl.Name.Equals("TxtDesc") && !string.IsNullOrEmpty(TxtDesc.Text))
         {
             TxtCom.Focus();
         }
         if (ctrl.Name.Equals("TxtBus"))
         {
             ButBusc.Focus();
         }
     }
 }
Beispiel #5
0
        private void cmdAdd_Click(object sender, EventArgs e)
        {
            GPItem.Visible = true;
            WSPresupuestos.WSPresupuestos WSPres = new WSPresupuestos.WSPresupuestos();
            WSPres.Url = mdlGenerales.DireccionWS + "FazServices/WSPresupuestos.asmx";
            Int32 Tipo = 0;

            if (rbHijo.Checked == true)
            {
                Tipo = 0;
            }
            else
            {
                Tipo = 1;
            }

            if (TxtDesc.Text.ToString() == "")
            {
                MessageBoxAdv.Show("Debe de registrar la descripción de la tarea", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                TxtDesc.Focus();
                return;
            }
            if ((txtMetrado.Text.ToString() == "") && (txtPrecio.Text.ToString() == "") && (txtUnidad.Text.ToString() == ""))
            {
                WSPres.AddItemPresupuesto(mdlGenerales.Conexion, strIDTipoPresupuesto, strIDProyecto, strNumeroRuc,
                                          lblItemNIvel1.Text.ToString(), lblItemNivel2.Text.ToString(), lblItemNivel3.Text.ToString(),
                                          lblItemNivel4.Text.ToString(), lblItemNivel5.Text.ToString(), lblNivel.Text.ToString(),
                                          Tipo.ToString(), TxtDesc.Text.ToString(), txtMetrado.Text.ToString(),
                                          txtUnidad.Text.ToString(), txtPrecio.Text.ToString());
                MessageBoxAdv.Show("Tarea Registrada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                if (chkContinuar.CheckState != CheckState.Checked)
                {
                    LimpiarPanel();
                    GPItem.Visible = false;
                    CargaGridPresupuesto(strIDTipoPresupuesto, strIDProyecto, strNumeroRuc);
                }
                else
                {
                    TxtDesc.Text    = "";
                    txtMetrado.Text = "";
                    txtUnidad.Text  = "";
                    txtPrecio.Text  = "";
                }
            }
            else
            {
                if ((txtMetrado.Text.ToString() != "") && (txtPrecio.Text.ToString() != "") && (txtUnidad.Text.ToString() != ""))
                {
                    if (MayorACero(txtMetrado.Text.ToString()) == false)
                    {
                        MessageBoxAdv.Show("El metrado debe de ser un valor númerico mayor a 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtMetrado.Focus();
                        return;
                    }
                    if (MayorACero(txtPrecio.Text.ToString()) == false)
                    {
                        MessageBoxAdv.Show("El metrado debe de ser un valor númerico mayor a 0", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtPrecio.Focus();
                        return;
                    }
                    WSPres.AddItemPresupuesto(mdlGenerales.Conexion, strIDTipoPresupuesto, strIDProyecto, strNumeroRuc,
                                              lblItemNIvel1.Text.ToString(), lblItemNivel2.Text.ToString(), lblItemNivel3.Text.ToString(),
                                              lblItemNivel4.Text.ToString(), lblItemNivel5.Text.ToString(), lblNivel.Text.ToString(),
                                              Tipo.ToString(), TxtDesc.Text.ToString(), txtMetrado.Text.ToString(),
                                              txtUnidad.Text.ToString(), txtPrecio.Text.ToString());
                    MessageBoxAdv.Show("Tarea Registrada", "Información", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    if (chkContinuar.CheckState != CheckState.Checked)
                    {
                        LimpiarPanel();
                        GPItem.Visible = false;
                        CargaGridPresupuesto(strIDTipoPresupuesto, strIDProyecto, strNumeroRuc);
                    }
                    else
                    {
                        TxtDesc.Text    = "";
                        txtMetrado.Text = "";
                        txtUnidad.Text  = "";
                        txtPrecio.Text  = "";
                    }
                }
                else
                {
                    if (txtMetrado.Text.ToString() == "")
                    {
                        MessageBoxAdv.Show("Debe de registrar el metrado de la tarea", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtMetrado.Focus();
                        return;
                    }
                    if (txtPrecio.Text.ToString() == "")
                    {
                        MessageBoxAdv.Show("Debe de registrar el precio de la tarea", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtPrecio.Focus();
                        return;
                    }
                    if (txtUnidad.Text.ToString() == "")
                    {
                        MessageBoxAdv.Show("Debe de registrar las unidades de la tarea", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        txtUnidad.Focus();
                        return;
                    }
                }
            }
        }
Beispiel #6
0
 private void Presionar(object sender, KeyEventArgs e)
 {
     ctrl = (Control)sender;
     if (ctrl.Name.Equals("TxtNom") && Activo)
     {
         Activo = true;
     }
     if (e.Key == Key.Enter)
     {
         if (ctrl.Name.Equals("TxtNom") && !string.IsNullOrEmpty(TxtNom.Text))
         {
             int idExiste = Requisito.ComprobarExistencia(TxtNom.Text);
             if (idExiste != -1)
             {
                 CargarRequisito(idExiste);
             }
             TxtVer.Focus();
         }
         if (ctrl.Name.Equals("TxtVer") && !string.IsNullOrEmpty(TxtVer.Text))
         {
             if (ClsFunciones.TryConvertToDouble(TxtVer.Text))
             {
                 TxtFec.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEVer);
             }
         }
         if (ctrl.Name.Equals("TxtFec") && !string.IsNullOrEmpty(TxtFec.Text))
         {
             if (ClsFunciones.TryConvertToDate(TxtFec.Text))
             {
                 TxtDesc.Focus();
             }
             else
             {
                 MessageBox.Show(StrMenEFec);
             }
         }
         if (ctrl.Name.Equals("TxtDesc") && !string.IsNullOrEmpty(TxtDesc.Text))
         {
             TxtCom.Focus();
         }
         if (ctrl.Name.Equals("TxtPreCond") && !string.IsNullOrEmpty(TxtPreCond.Text))
         {
             TxtSecNor.Focus();
         }
         if (ctrl.Name.Equals("TxtPostCond") && !string.IsNullOrEmpty(TxtPostCond.Text))
         {
             TxtSecExc.Focus();
         }
         if (ctrl.Name.Equals("TxtBus"))
         {
             ButBusc.Focus();
         }
         if (ctrl.Name.Equals("TxtSecNor") && !string.IsNullOrEmpty(TxtSecNor.Text))
         {
             if (LinSNor == -1)
             {
                 Requisito.SecNormal.Add(new ClsDatDG()
                 {
                     Descrip = TxtSecNor.Text
                 });
             }
             else
             {
                 Requisito.SecNormal.Insert(LinSNor, new ClsDatDG()
                 {
                     Descrip = TxtSecNor.Text
                 });
             }
             LinSNor        = -1;
             TxtSecNor.Text = string.Empty;
         }
         if (ctrl.Name.Equals("TxtSecExc") && !string.IsNullOrEmpty(TxtSecExc.Text))
         {
             if (LinSExc == -1)
             {
                 Requisito.SecExcepc.Add(new ClsDatDG()
                 {
                     Descrip = TxtSecExc.Text
                 });
             }
             else
             {
                 Requisito.SecExcepc.Insert(LinSExc, new ClsDatDG()
                 {
                     Descrip = TxtSecExc.Text
                 });
             }
             LinSExc        = -1;
             TxtSecExc.Text = string.Empty;
         }
     }
 }
Beispiel #7
0
        bool CamposOK()
        {
            bool booEstado = true;

            TxtCodPro.Text = GeneraCodigoProducto();

            if (Convert.ToInt16(CboTipExi.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado el tipo de existencia !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboTipExi.Focus();
                return(booEstado);
            }

            if (Convert.ToInt16(CboFam.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la familia del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboFam.Focus();
                return(booEstado);
            }

            if (Convert.ToInt16(CboCla.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la clase del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboCla.Focus();
                return(booEstado);
            }
            if (Convert.ToInt16(CboSubCla.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la sub clase del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboSubCla.Focus();
                return(booEstado);
            }
            //if (Convert.ToInt16(CboUniMed.SelectedValue) == 0)
            //{
            //    MessageBox.Show("¡ No ha especificado la unidad de medida del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
            //    booEstado = false;
            //    CboUniMed.Focus();
            //    return booEstado;
            //}
            if (Convert.ToInt16(CboMoneda.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la moneda del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboMoneda.Focus();
                return(booEstado);
            }
            if (Convert.ToInt16(CboPlay.SelectedValue) == 0)
            {
                MessageBox.Show("¡ No ha especificado la playa de venta del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                CboPlay.Focus();
                return(booEstado);
            }
            if (funFunciones.NulosC(TxtCodPro.Text) == "")
            {
                MessageBox.Show("¡ No ha especificado el codigo del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtCodPro.Focus();
                return(booEstado);
            }
            if (funFunciones.NulosC(TxtDesc.Text) == "")
            {
                MessageBox.Show("¡ No ha especificado la descripcion del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                booEstado = false;
                TxtDesc.Focus();
                return(booEstado);
            }
            if (OptSiPagSer.Checked == true)
            {
                if (funFunciones.NulosC(TxtPrecio.Text) == "")
                {
                    MessageBox.Show("¡ No ha especificado el precio bruto del servicio !", "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1);
                    booEstado = false;
                    TxtPrecio.Focus();
                    return(booEstado);
                }
            }
            return(booEstado);
        }