private void btnsalvar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtcod.Text.Trim()))
            {
                MessageBox.Show("Campo codigo es obligatorio, favor revisar.");
                txtcod.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtnombre.Text.Trim()))
            {
                MessageBox.Show("Campo nombre es obligatorio, favor revisar.");
                txtnombre.Focus();
                return;
            }
            string vcod = txtcod.Text.Trim(), vdes = txtnombre.Text.Trim();

            Ctool.ExcSql($"exec Gen.proc_tdocumentaciones @idcompania = {Ctool.cia} ,@id = {vcod},@nombre = '{vdes}' ");
            if (Ctool.OcError)
            {
                return;
            }

            llenargrid();
            limpiar();
        }
Beispiel #2
0
        private void btnsalvar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtcod.Text.Trim()))
            {
                MessageBox.Show("Campo codigo es obligatorio, favor revisar.");
                txtcod.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtdescripcion.Text.Trim()))
            {
                MessageBox.Show("Campo descripcion es obligatorio, favor revisar.");
                txtdescripcion.Focus();
                return;
            }
            string vcod = txtcod.Text.Trim(), vdes = txtdescripcion.Text.Trim();
            int    vest = Convert.ToInt32(Rbact.Checked);

            Ctool.ExcSql($"exec reclamos.proc_acciones @idcomp = {Ctool.cia} ,@id = {vcod},@des = '{vdes}',@est = {vest} ");
            if (Ctool.OcError)
            {
                return;
            }

            llenargrid();
            limpiar();
        }
        private void llenarcampos()
        {
            DataTable dt = Ctool.ExcSqlDT("Select * from V_Operador_Departamento where idcompania = " + Ctool.cia + " and id = " + txtcod.Text.Trim());

            if (dt.Rows.Count > 0)
            {
                txtnombre.Text   = dt.Rows[0]["nombre"].ToString();
                txtapellido.Text = dt.Rows[0]["apellidos"].ToString();

                txtiddep.Text  = dt.Rows[0]["iddepartamento"].ToString();
                txtdesdep.Text = dt.Rows[0]["Descripcion"].ToString();
                Tentrada.Text  = dt.Rows[0]["horaentrada"].ToString();
                TSalida.Text   = dt.Rows[0]["horasalida"].ToString();
                Tbreaki.Text   = dt.Rows[0]["horabreaki"].ToString();
                BreakF.Text    = dt.Rows[0]["horabreaks"].ToString();
                Rbact.Checked  = Convert.ToBoolean(dt.Rows[0]["estado"]);
                Rbinac.Checked = !Convert.ToBoolean(dt.Rows[0]["estado"]);


                camposlec(false);
                txtnombre.Focus();
            }
            else
            {
                camposlec(true);
                limpiar(false);
            }
        }
Beispiel #4
0
 private void llenarreclamos()
 {
     dtrecla = Ctool.ExcSqlDT($"select id,descripcion from Reclamos.Tipo_Reclamos where idcompania = {Ctool.cia}");
     cmbreclamos.DataSource    = dtrecla;
     cmbreclamos.ValueMember   = "id";
     cmbreclamos.DisplayMember = "descripcion";
 }
        private void btnborrar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtcod.Text.Trim()))
            {
                MessageBox.Show("Campo codigo es obligatorio, favor revisar.");
                txtcod.Focus();
                return;
            }

            if (Ctool.ExcSqlDT($"select id  from V_operador where idcompania =  {Ctool.cia} and id = { txtcod.Text.Trim()} ").Rows.Count == 0)
            {
                return;
            }

            DialogResult dresult = MessageBox.Show($"Esta seguro que desea borrar el id operador : {txtcod.Text.Trim()} ?", "ReclamosApp", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dresult == DialogResult.Yes)
            {
                string veje = $"Update Entidad.Empleados set Estado = 0 where idcompania =  {Ctool.cia} and id = { txtcod.Text.Trim()} ";
                Ctool.ExcSql(veje);
                if (Ctool.OcError)
                {
                    MessageBox.Show("Ocurrio un error en el proceso de desactivar operador");
                    return;
                }
                llenargrid();
                limpiar();
            }
        }
Beispiel #6
0
        private void btnsalvar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtcoddep.Text.Trim()))
            {
                MessageBox.Show("Campo codigo es obligatorio, favor revisar.");
                txtcoddep.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtdescripcion.Text.Trim()))
            {
                MessageBox.Show("Campo descripcion es obligatorio, favor revisar.");
                txtdescripcion.Focus();
                return;
            }

            if (string.IsNullOrEmpty(txtidencargado.Text.Trim()))
            {
                MessageBox.Show("Campo Id Encargado es obligatorio, favor revisar.");
                txtidencargado.Focus();
                return;
            }


            if (string.IsNullOrEmpty(txtfuncion.Text.Trim()))
            {
                MessageBox.Show("Campo Funcion es obligatorio, favor revisar.");
                txtfuncion.Focus();
                return;
            }
            string vcod = txtcoddep.Text.Trim();
            string vdes = txtdescripcion.Text.Trim();

            string viden = String.IsNullOrEmpty(txtidencargado.Text.Trim()) ? "0" : txtidencargado.Text.Trim();

            string vfun = txtfuncion.Text.Trim();
            string vest = "1";

            if (!Rbact.Checked)
            {
                vest = "0";
            }



            string v1 = $"exec reclamos.Proc_Departamentos  @idcom = {Ctool.cia} , @id = {vcod} , @Des = '{vdes}' , @funcion= '{vfun}',";

            v1 += $"@idenc  = {viden} ,";
            v1 += $" @est = {vest}";

            Ctool.ExcSql(v1);
            if (Ctool.OcError)
            {
                MessageBox.Show("Ocurrio un error en el procedimiento de salvar.");
                return;
            }


            llenargrid();
            limpiar();
        }
Beispiel #7
0
 private void llenaroperadores()
 {
     dtope = Ctool.ExcSqlDT($"select id,rtrim(nombre)+' '+rtrim(apellidos) as nom from V_Empleados where idcompania = {Ctool.cia} and idtipo = 1 and disponible = 1");
     cmboperador.DataSource    = dtope;
     cmboperador.ValueMember   = "id";
     cmboperador.DisplayMember = "nom";
 }
        private void btnborrar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtcod.Text.Trim()))
            {
                MessageBox.Show("Campo codigo es obligatorio, favor revisar.");
                txtcod.Focus();
                return;
            }

            string vcod = txtcod.Text.Trim();

            DialogResult dresult = MessageBox.Show($"Esta seguro que desea borrar el id Tipo reclamo : {txtcod.Text.Trim()} ?", "ReclamosApp", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (dresult == DialogResult.Yes)
            {
                Ctool.ExcSql($"delete from reclamos.Tipo_Reclamos  where idcompania = {Ctool.cia} and id = {vcod}");
                if (Ctool.OcError)
                {
                    MessageBox.Show("Ocurrio un error para borrar de Tipos Reclamos.", "ReclamosApp", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            llenargrid();
            limpiar();
        }
        private void llenarcampos()
        {
            if (String.IsNullOrEmpty(txtidaccion.Text.Trim()) || String.IsNullOrEmpty(txtidreclamo.Text.Trim()))
            {
                return;
            }

            DataTable dt = Ctool.ExcSqlDT($"select * from reclamos.Tipos_Reclamos_Acciones where idcompania = {Ctool.cia} and idtipo = {txtidreclamo.Text.Trim()} and idaccion = {txtidaccion.Text.Trim()}");

            if (dt.Rows.Count > 0)
            {
                numrepresenta.Value = Convert.ToInt32(dt.Rows[0]["representa"]);
                Rbact.Checked       = Convert.ToBoolean(dt.Rows[0]["estado"]);
                Rbinac.Checked      = !Convert.ToBoolean(dt.Rows[0]["estado"]);

                llenaraccion();
                llenarreclamos();
                camposlec(false);
                numrepresenta.Focus();
            }
            else
            {
                camposlec(true);
                limpiar(false);
            }
        }
        private void llenaraccion()
        {
            if (String.IsNullOrEmpty(txtidaccion.Text.Trim()))
            {
                return;
            }


            DataTable dt = Ctool.ExcSqlDT("Select * from reclamos.acciones where idcompania = " + Ctool.cia + " and id = " + txtidaccion.Text.Trim());

            if (dt.Rows.Count > 0)
            {
                txtdesaccion.Text = dt.Rows[0]["descripcion"].ToString().Trim();

                foreach (DataRow item in dtdataacciones.Rows)
                {
                    if (item["idaccion"].ToString().Trim() == txtidaccion.Text.Trim())
                    {
                        txtidemp.Text  = item["idempleado"].ToString().Trim();
                        txtnomemp.Text = item["nombreemp"].ToString().Trim();
                        fechai.Value   = Convert.ToDateTime(item["finicio"]);
                        fechaf.Value   = Convert.ToDateTime(item["ffin"]);
                        horai.Value    = Convert.ToDateTime(item["horai"]);
                        horaf.Value    = Convert.ToDateTime(item["horaf"]);
                        txtnota.Text   = item["nota"].ToString().Trim();
                    }
                }
            }
            else
            {
                txtdesaccion.Text = String.Empty;
            }
        }
Beispiel #11
0
        private void btnsalvar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtcodnivel.Text.Trim()))
            {
                MessageBox.Show("Campo codigo es obligatorio, favor revisar.");
                txtcodnivel.Focus();
                return;
            }
            if (string.IsNullOrEmpty(txtdescripcion.Text.Trim()))
            {
                MessageBox.Show("Campo descripcion es obligatorio, favor revisar.");
                txtdescripcion.Focus();
                return;
            }
            string vcod = txtcodnivel.Text.Trim(), vdes = txtdescripcion.Text.Trim();
            string query = string.Format("exec insertar_tpsniveles {0},{1},'{2}',{3}", Ctool.cia, txtcodnivel.Text, txtdescripcion.Text, numnivel.Value);

            Ctool.ExcSql(query);
            if (Ctool.OcError)
            {
                return;
            }

            llenargrid();
            limpiar();
        }
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select idtipo,desre,idaccion,desac  from V_Tipos_Reclamos_Acciones2 where idcompania = " + Ctool.cia + vfil + " order by idtipo desc");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT($"select id, nombre from Gen.Tipos_CLientes where idcompania =  {Ctool.cia} {vfil}");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
Beispiel #14
0
 private void llenargrid(string vfil = "0")
 {
     dtdata = Ctool.ExcSqlDT($"select descripcion from V_Tipos_Reclamos_Acciones where idcompania = {Ctool.cia} and estado = 1 and idtipo = {vfil}");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT($"select id, descripcion from Reclamos.Tipos_Niveles where idcompania =  {Ctool.cia} {vfil}");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select id,Rtrim(nombre)+' '+Rtrim(Apellidos) as Nombre  from V_Clientes where idcompania = " + Ctool.cia + vfil + " order by id desc");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
Beispiel #17
0
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select id, nombre, nota from Gen.Tipos_Usuarios where idcompania = " + Ctool.cia + " " + vfil);
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
 private void llenargridrecomendado(string vfil = " and 1=2")
 {
     dtdatag1 = Ctool.ExcSqlDT($"select descripcion from V_Tipos_Reclamos_Acciones where idcompania = {Ctool.cia} and estado = 1  {vfil}");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdatag1;
 }
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select id, descripcion from Gen.Tipos_Empleados where idcompania = " + Ctool.cia);
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
Beispiel #20
0
 private void llenargrid(string vfil = "")
 {
     dt = Ctool.ExcSqlDT("select id,descripcion,nivel from reclamos.Tipos_Niveles  where idcompania = " + Ctool.cia);
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dt;
 }
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select id, nombre from Gen.Tipos_Documentaciones where idcompania = " + Ctool.cia);
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select id,descripcion,estado from reclamos.Tipo_Reclamos where idcompania = " + Ctool.cia + vfil + " order by id desc");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
Beispiel #23
0
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select id,nombre from Dir.Pais" + vfil + " order by id desc");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
Beispiel #24
0
 private void llenargrid(string vfil = "")
 {
     dtdata = Ctool.ExcSqlDT("select top(100) id,Convert(varchar(10),idcliente)+' - '+Rtrim(nombre)+' '+Rtrim(Apellidos) as cliente,fecha,convert(varchar(10),idtipo)+' - '+descripcion as reclamo,case when estado = 1 then 'En Proceso' else 'Terminado' end as estado  from V_Reclamos_Niveles where idcompania = " + Ctool.cia + vfil + " order by nivel desc");
     if (Ctool.OcError)
     {
         return;
     }
     dataGridView1.DataSource = dtdata;
 }
        private void llenarcampos()
        {
            if (string.IsNullOrEmpty(txtcod.Text))
            {
                return;
            }

            DataTable dt = Ctool.ExcSqlDT("Select * from V_Usuarios where idcompania = " + Ctool.cia + " and id = " + txtcod.Text.Trim());

            if (dt.Rows.Count > 0)
            {
                txtclave.Enabled     = false;
                Chkmodificar.Enabled = true;
                txtnombre.Text       = dt.Rows[0]["Nombre"].ToString();
                txtapellido.Text     = dt.Rows[0]["apellidos"].ToString();
                txtidtipo.Text       = dt.Rows[0]["idtipo"].ToString();
                txtclave.Text        = dt.Rows[0]["clave"].ToString();
                txtusuario.Text      = dt.Rows[0]["usuario"].ToString();

                Chkautorizar.Checked = Convert.ToBoolean(dt.Rows[0]["autorizar"]);
                Rbact.Checked        = Convert.ToBoolean(dt.Rows[0]["estado"]);
                Rbinac.Checked       = !Convert.ToBoolean(dt.Rows[0]["estado"]);

                string    vterid = dt.Rows[0]["idterceros"].ToString();
                DataTable dttels = Ctool.ExcSqlDT("Select * from Entidad.Telefonos where idcompania = " + Ctool.cia + " and idterceros = " + vterid);
                txtel.Text = txtcorreo.Text = String.Empty;
                foreach (DataRow item in dttels.Rows)
                {
                    if (Convert.ToInt32(item["idtipo"]) == 1)
                    {
                        txtel.Text = item["telefono"].ToString();
                    }
                    else if (txtel.Text.Trim().Length == 0)
                    {
                        txtel.Text = item["telefono"].ToString();
                    }
                }
                DataTable dtcor = Ctool.ExcSqlDT("Select * from Entidad.Correos where idcompania = " + Ctool.cia + " and idterceros = " + vterid);
                if (dtcor.Rows.Count > 0)
                {
                    txtcorreo.Text = dtcor.Rows[0]["correo"].ToString();
                }

                llenartipo();
                camposlec(false);
                txtnombre.Focus();
            }
            else
            {
                Chkmodificar.Enabled = false;
                camposlec(true);
                limpiar(false);
            }
        }
 private void txtcodprovincia_Validating(object sender, CancelEventArgs e)
 {
     if (!String.IsNullOrEmpty(txtcodprovincia.Text.Trim()))
     {
         txtnomprovincia.Text = Ctool.nomdir("Dir.Provincias", $"id = {txtcodprovincia.Text.Trim()} and idpais = {txtcodpais.Text.Trim()}");
     }
     else
     {
         txtnomprovincia.Text = string.Empty;
     }
 }
 private void txtcodcalle_Validating(object sender, CancelEventArgs e)
 {
     if (!String.IsNullOrEmpty(txtcodcalle.Text.Trim()))
     {
         txtcalle.Text = Ctool.nomdir("Dir.Calles", $" id = {txtcodcalle.Text.Trim()} and idparaje = {txtcodparaje.Text.Trim()} and idsector = {txtcodsector.Text.Trim()} and idmunicipio = {txtcodmunicipio.Text.Trim()} and idprovincia = {txtcodprovincia.Text.Trim()} and idpais = {txtcodpais.Text.Trim()}");
     }
     else
     {
         txtcalle.Text = string.Empty;
     }
 }
 private void txtiddep_Validating(object sender, CancelEventArgs e)
 {
     if (!String.IsNullOrEmpty(txtiddep.Text.Trim()))
     {
         txtdesdep.Text = Ctool.desdep("reclamos.Departamentos", $"id = {txtiddep.Text.Trim()}");
     }
     else
     {
         txtdesdep.Text = string.Empty;
     }
 }
Beispiel #29
0
 private void txtidencargado_Validating(object sender, CancelEventArgs e)
 {
     if (!String.IsNullOrEmpty(txtidencargado.Text.Trim()))
     {
         txtnomencargado.Text = Ctool.nomentidades("V_EMPLEADOS", $"idcompania = {Ctool.cia} and id = {txtidencargado.Text.Trim()}");
     }
     else
     {
         txtnomencargado.Text = string.Empty;
     }
 }
Beispiel #30
0
        private void llenargrid(string vfil = "")
        {
            dtdata = Ctool.ExcSqlDT("select Id," +
                                    "Descripcion,Idencargado,Funcion,Estado " +
                                    "from reclamos.Departamentos where Idcompania = " + Ctool.cia + vfil);

            if (Ctool.OcError)
            {
                return;
            }
            dataGridView1.DataSource = dtdata;
        }