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;
            }
        }
        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);
            }
        }
        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 #5
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";
 }
Beispiel #6
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 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;
 }
 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;
 }
Beispiel #10
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 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 #12
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 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, descripcion from Gen.Tipos_Empleados where idcompania = " + Ctool.cia);
     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;
 }
Beispiel #18
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 #19
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 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 llenargridacciones(string vfil = "")
        {
            string vcod;

            vcod = txtcod.Text.Trim();
            if (string.IsNullOrEmpty(vcod))
            {
                vcod = "0";
            }
            dtdataacciones           = Ctool.ExcSqlDT($"Select idaccion,descripcion,idempleado,nombre+' '+Apellidos as nombreemp,finicio,convert(varchar(20), finicio, 108) as horai,ffin,convert(varchar(20), ffin, 108) as horaf,nota from V_Transacciones_Detalles where idcompania = {Ctool.cia} and id = {txtcod.Text.Trim()}");
            dataGridView2.DataSource = dtdataacciones;
        }
        private void llenarcampos()
        {
            DataTable dt = Ctool.ExcSqlDT("Select * from V_Clientes_Direcciones where idcompania = " + Ctool.cia + " and id = " + txtcoddep.Text.Trim());

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

                txtdir.Text          = dt.Rows[0]["referencia"].ToString();
                txtcodpais.Text      = dt.Rows[0]["idpais"].ToString();
                txtnompais.Text      = dt.Rows[0]["pais"].ToString();
                txtcodprovincia.Text = dt.Rows[0]["idprovincia"].ToString();
                txtnomprovincia.Text = dt.Rows[0]["provincia"].ToString();
                txtcodmunicipio.Text = dt.Rows[0]["idmunicipio"].ToString();
                txtmunicipio.Text    = dt.Rows[0]["municipio"].ToString();
                txtsector.Text       = dt.Rows[0]["sector"].ToString();
                txtcodsector.Text    = dt.Rows[0]["idsector"].ToString();
                txtcalle.Text        = dt.Rows[0]["calle"].ToString();
                txtcodcalle.Text     = dt.Rows[0]["idcalle"].ToString();
                txtparaje.Text       = dt.Rows[0]["paraje"].ToString();
                txtcodparaje.Text    = dt.Rows[0]["idparaje"].ToString();
                Rbact.Checked        = Convert.ToBoolean(dt.Rows[0]["estado"]);
                Rbinac.Checked       = !Convert.ToBoolean(dt.Rows[0]["estado"]);

                string    vterid = dt.Rows[0]["idtercero"].ToString();
                DataTable dttels = Ctool.ExcSqlDT("Select * from Entidad.Telefonos where idcompania = " + Ctool.cia + " and idterceros = " + vterid);
                txtel.Text = txtcel.Text = txtemail.Text = String.Empty;
                foreach (DataRow item in dttels.Rows)
                {
                    if (Convert.ToInt32(item["idtipo"]) == 1)
                    {
                        txtel.Text = item["telefono"].ToString();
                    }
                    else if (Convert.ToInt32(item["idtipo"]) == 2)
                    {
                        txtcel.Text = item["telefono"].ToString();
                    }
                }
                DataTable dtcor = Ctool.ExcSqlDT("Select * from Entidad.Correos where idcompania = " + Ctool.cia + " and idterceros = " + vterid);
                if (dtcor.Rows.Count > 0)
                {
                    txtemail.Text = dtcor.Rows[0]["correo"].ToString();
                }
                camposlec(false);
                txtnombre.Focus();
            }
            else
            {
                camposlec(true);
                limpiar(false);
            }
        }
Beispiel #23
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;
        }
Beispiel #24
0
        public static string nomentidades(string vtbl, string vwhere)
        {
            DataTable dtent = Ctool.ExcSqlDT($"Select nombre+' '+apellidos from {vtbl} where  {vwhere}");

            if (dtent.Rows.Count > 0)
            {
                return(dtent.Rows[0][0].ToString().Trim());
            }
            else
            {
                return("Error. No existe.");
            }
        }
Beispiel #25
0
        public static string desdep(string vtbl, string vwhere)
        {
            DataTable dtdes = Ctool.ExcSqlDT($"Select Descripcion from {vtbl} where  {vwhere}");

            if (dtdes.Rows.Count > 0)
            {
                return(dtdes.Rows[0][0].ToString().Trim());
            }
            else
            {
                return("Error. No existe.");
            }
        }
Beispiel #26
0
        public static string nomdir(string vtbl, string vwhere)
        {
            DataTable dtdir = Ctool.ExcSqlDT($"Select nombre from {vtbl} where  {vwhere}");

            if (dtdir.Rows.Count > 0)
            {
                return(dtdir.Rows[0][0].ToString().Trim());
            }
            else
            {
                return("Error. No existe.");
            }
        }
Beispiel #27
0
        private void BtnImprimir_Click(object sender, EventArgs e)
        {
            string v1   = "SELECT  idcompania,id,idtipo,descripcion,idcliente,nombre+' '+Apellidos as nomcli,fecha,nota";
            string v2   = " FROM V_Reclamos_Detallado  ";
            string v3   = $" WHERE idcompania = {Ctool.cia} and  FECHA BETWEEN '{dateTimePicker1.Value.ToString("yyyy-MM-dd")}' AND '{dateTimePicker2.Value.ToString("yyyy-MM-dd")}'";
            string vcmd = v1 + v2 + v3;
            var    dt   = Ctool.ExcSqlDT(vcmd);

            if (Ctool.OcError)
            {
                MessageBox.Show("Error select reclamos");
                return;
            }
            var Res = dt.AsEnumerable()
                      .Select(x => new Reclamosdetalle()
            {
                idcompania = x.Field <int>("idcompania"),
                id         = x.Field <int>("id"),
                idtipo     = x.Field <int>("idtipo"),
                idcliente  = x.Field <int>("idcliente"),
                fecha      = x.Field <DateTime>("fecha"),
                nomcli     = x.Field <string>("nomcli"),
                nomrec     = x.Field <string>("descripcion"),
                nota       = x.Field <string>("nota"),
            }).OrderBy(x => x.id).ToList();

            var frmp = new FrmReporte();
            var rv   = frmp.Rpv;

            rv.Clear();
            rv.Reset();
            if (rv.LocalReport.DataSources.Any())
            {
                rv.LocalReport.DataSources.Clear();
            }

            //ok, prueba.
            rv.LocalReport.ReportEmbeddedResource = "Reclamos.rep.ReportReclamosD.rdlc";
            List <ReportParameter> reportParameters = new List <ReportParameter>();

            reportParameters.Add(new ReportParameter("PrmUno", "Reclamos APP"));
            rv.LocalReport.SetParameters(reportParameters);

            //PrmUno
            rv.LocalReport.DataSources.Add(new ReportDataSource("DsReclamosD", Res));


            rv.RefreshReport();

            frmp.ShowDialog();
        }
Beispiel #28
0
        private void BtnImprimir_Click(object sender, EventArgs e)
        {
            string v1 = " SELECT Count(*) as Cantidad,reclamos.Transacciones.idcompania, reclamos.Transacciones.idcliente, dbo.V_Clientes.apellidos+' '+dbo.V_Clientes.nombre as nomcli";
            string v2 = " FROM reclamos.Transacciones INNER JOIN";
            string v3 = " dbo.V_Clientes ON reclamos.Transacciones.idcompania = dbo.V_Clientes.idcompania AND reclamos.Transacciones.idcliente = dbo.V_Clientes.id";
            string v4 = $" WHERE (reclamos.Transacciones.idcompania = {Ctool.cia}) and (reclamos.Transacciones.fecha BETWEEN '{dateTimePicker1.Value.ToString("yyyy-MM-dd")}' AND '{dateTimePicker2.Value.ToString("yyyy-MM-dd")}')";
            string v5 = " GROUP BY reclamos.Transacciones.idcompania, reclamos.Transacciones.idcliente, dbo.V_Clientes.apellidos, dbo.V_Clientes.nombre";

            string vcmd = v1 + v2 + v3 + v4 + v5;
            var    dt   = Ctool.ExcSqlDT(vcmd);

            if (Ctool.OcError)
            {
                MessageBox.Show("Error select reclamos");
                return;
            }
            var Res = dt.AsEnumerable()
                      .Select(x => new Reclamosxclientes()
            {
                idcompania = x.Field <int>("idcompania"),
                cantidad   = x.Field <int>("Cantidad"),
                idcliente  = x.Field <int>("idcliente"),
                nomcli     = x.Field <string>("nomcli"),
            }).OrderByDescending(x => x.cantidad).ToList();

            var frmp = new FrmReporte();
            var rv   = frmp.Rpv;

            rv.Clear();
            rv.Reset();
            if (rv.LocalReport.DataSources.Any())
            {
                rv.LocalReport.DataSources.Clear();
            }

            //ok, prueba.
            rv.LocalReport.ReportEmbeddedResource = "Reclamos.rep.ReportReclamosCli.rdlc";
            List <ReportParameter> reportParameters = new List <ReportParameter>();

            reportParameters.Add(new ReportParameter("PrmUno", "Reclamos APP"));
            rv.LocalReport.SetParameters(reportParameters);

            //PrmUno
            rv.LocalReport.DataSources.Add(new ReportDataSource("DsCliRecl", Res));


            rv.RefreshReport();

            frmp.ShowDialog();
        }
Beispiel #29
0
        private void BtnImprimir_Click(object sender, EventArgs e)
        {
            string v1   = "SELECT COUNT(*) AS CANTIDAD, reclamos.Transacciones.idcompania, reclamos.Transacciones.idtipo, reclamos.Tipo_Reclamos.descripcion";
            string v2   = " FROM reclamos.Tipo_Reclamos INNER JOIN reclamos.Transacciones ON reclamos.Tipo_Reclamos.idcompania = reclamos.Transacciones.idcompania AND reclamos.Tipo_Reclamos.id = reclamos.Transacciones.idtipo";
            string v3   = $" WHERE reclamos.Transacciones.FECHA BETWEEN '{dateTimePicker1.Value.ToString("yyyy-MM-dd")}' AND '{dateTimePicker2.Value.ToString("yyyy-MM-dd")}'";
            string v4   = " GROUP BY reclamos.Transacciones.idcompania, reclamos.Transacciones.idtipo, reclamos.Tipo_Reclamos.descripcion";
            string vcmd = v1 + v2 + v3 + v4;
            var    dt   = Ctool.ExcSqlDT(vcmd);

            if (Ctool.OcError)
            {
                MessageBox.Show("Error select reclamos");
                return;
            }
            var Res = dt.AsEnumerable()
                      .Select(x => new ReclamosAgrup()
            {
                idcompania  = x.Field <int>("idcompania"),
                cantidad    = x.Field <int>("cantidad"),
                id          = x.Field <int>("idtipo"),
                descripcion = x.Field <string>("descripcion").Trim()
            }).OrderByDescending(x => x.cantidad).ToList();

            var frmp = new FrmReporte();
            var rv   = frmp.Rpv;

            rv.Clear();
            rv.Reset();
            if (rv.LocalReport.DataSources.Any())
            {
                rv.LocalReport.DataSources.Clear();
            }

            //ok, prueba.
            rv.LocalReport.ReportEmbeddedResource = "Reclamos.rep.ReportModelo.rdlc";
            List <ReportParameter> reportParameters = new List <ReportParameter>();

            reportParameters.Add(new ReportParameter("PrmUno", "Reclamos APP"));
            rv.LocalReport.SetParameters(reportParameters);

            //PrmUno
            rv.LocalReport.DataSources.Add(new ReportDataSource("DsNom", Res));


            rv.RefreshReport();

            frmp.ShowDialog();
        }
        private void llenarcampos()
        {
            DataTable dt = Ctool.ExcSqlDT("Select * from Gen.Tipos_Documentaciones where idcompania = " + Ctool.cia + " and id = " + txtcod.Text.Trim());

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

                camposlec(false);
                txtnombre.Focus();
            }
            else
            {
                camposlec(true);
                limpiar(false);
            }
        }