Exemplo n.º 1
0
        private void bcnombretxt_KeyUp(object sender, KeyEventArgs e)
        {
            int count = bcnombretxt.TextLength;
            if (count >= 3)
            {
                string buscar = bcnombretxt.Text;
                Cliente c = new Cliente();
                DataTable dt = c.ClienteBuscar(buscar,"CL_NOMBRE");
                // clienteListalv. = dt;

                FillList(this.m_buscarcliente_list, dt);

            }
        }
Exemplo n.º 2
0
        private void genReporte(string sdate, string edate)
        {
            Cliente c = new Cliente();
            DataTable dt = c.IngresoMensual(sdate, edate);
            // clienteListalv. = dt;
            int[] colsize = {90,70,250,60,90,90,90 };
            LlenarLista llenar = new LlenarLista(this.m_list, dt,colsize);
            //FillList(this.m_list, dt);

            SqlDataReader ingreso = c.IngresoMensualSuma(sdate, edate);
            //populate total
            ListViewItem item = new ListViewItem();
            item.Text = "TOTAL";
            item.SubItems.Add("-");
            item.SubItems.Add("-");
            item.SubItems.Add("-");
            if (ingreso.Read())
            {
                item.SubItems.Add(ingreso["Capital"].ToString()); //capital
                item.SubItems.Add(ingreso["Interes"].ToString()); //interes
               // item.SubItems.Add(ingreso["Mora"].ToString()); //mora place holder
                item.SubItems.Add(ingreso["Monto"].ToString());

                double capitalstr = 0.00;
                double interesstr = 0.00;
                double morastr = 0.00;
                double t = 0.00;

                if (ingreso["Capital"].ToString() != "")
                {
                    capitalstr = Double.Parse(ingreso["Capital"].ToString());
                }
                if (ingreso["Interes"].ToString() != "")
                {
                    interesstr = Double.Parse(ingreso["Interes"].ToString());
                }
                if (ingreso["Mora"].ToString() != "")
                {
                    morastr = Double.Parse(ingreso["Mora"].ToString());
                }

                capitallb.Text = String.Format("{0:C}", capitalstr);
                interestlb.Text = String.Format("{0:C}", interesstr);
                moralb.Text = String.Format("{0:C}", morastr);
                t = capitalstr + interesstr + morastr;
                totallb.Text = String.Format("{0:C}", t);
            }
            this.m_list.Items.Add(item);
            this.m_list.ResumeLayout();
        }
Exemplo n.º 3
0
        private void bccodigotxt_TextChanged(object sender, EventArgs e)
        {
            int count = bccodigotxt.TextLength;
            if (count >= 3)
            {
                string buscar = bccodigotxt.Text;
                Cliente c = new Cliente();
                DataTable dt = c.ClienteBuscar(buscar,"CL_CODIGO");
                // clienteListalv. = dt;

                FillList(this.m_buscarcliente_list, dt);

            }
        }
 public void loadZona()
 {
     Cliente c = new Cliente();
     SqlDataReader zona = c.getZona();
     ArrayList zonalist = new ArrayList();
     while (zona.Read())
     {
         zonalist.Add(new AddValue(zona["ZO_NOMBRE"].ToString(),zona["ZO_CODIGO"].ToString()));
     }
     zona.Close();
     zonacb.DataSource = zonalist;
     zonacb.DisplayMember = "Display";
     zonacb.ValueMember = "Value" ;
 }
Exemplo n.º 5
0
        private void ClienteLista_Load(object sender, EventArgs e)
        {
            fechatxt.Text = DateTime.Now.ToString("dd-MM-yyyy");
            string tmpfecha = DateTime.Now.ToString("yyyy-MM-dd");

            Cliente c = new Cliente();
            DataTable dt = c.ClienteListaHoy(tmpfecha);
            LlenarLista llenar;
               // clienteListalv. = dt;
            FillList(this.m_list, dt);
            dt = c.ClienteListaAtraso("0");
            int[] col = {90,270,90};
            llenar = new LlenarLista(this.m_listaatraso, dt,col);

            //load inactivo
            dt = c.ClienteListaAtraso("1");
            llenar = new LlenarLista(this.inactivolistview, dt, col);
        }
Exemplo n.º 6
0
        private void loadHistoria()
        {
            Cliente cl = new Cliente();
            Editors = new Control[] { textfieldtxt };
            isReciboToday = cl.isReciboToday(ReciboID);
            if (isReciboToday)
            {
                grabarBtn.Enabled = true;
            }

            SqlDataReader psql = cl.loadReciboHistoria(ReciboID);
            m_recibo_list.SuspendLayout();
            // Clear list
            m_recibo_list.Items.Clear();
            m_recibo_list.Columns.Clear();

            // load list column
            // Prestamos Columns
            m_recibo_list.Columns.Add("Cuota", 50);
            m_recibo_list.Columns.Add("Prestamo", 65);
            m_recibo_list.Columns.Add("Fecha", 70);
            m_recibo_list.Columns.Add("Capital", 65);
            m_recibo_list.Columns.Add("Interes", 65);
            m_recibo_list.Columns.Add("Mora", 65);

            while (psql.Read())
            {
                // load list data
                ListViewItem item = new ListViewItem();
                Codigo = psql["CL_CODIGO"].ToString();
                PrestamoID = psql["Prestamo"].ToString();
                item.Text = psql["Cuota"].ToString();
                item.SubItems.Add(psql["Prestamo"].ToString());
                item.SubItems.Add(psql["Fecha"].ToString());
                item.SubItems.Add(psql["Capital"].ToString());
                item.SubItems.Add(psql["Interes"].ToString());
                item.SubItems.Add(psql["Mora"].ToString());
                m_recibo_list.Items.Add(item);
            }
            psql.Close();

            m_recibo_list.ResumeLayout();
        }
Exemplo n.º 7
0
        public void loadClienteInfo(string codigo)
        {
            cliente1 = new Cliente(codigo);

            //cli.loadClienteInfo(c);
            char[] myChar = { ' ' };
            string[] nombre = cliente1.NOMBRE.Split(myChar);
            this.Text += nombre[0];

            codigotxt.Text = cliente1.CODIGO;
            nombretxt.Text = cliente1.NOMBRE;
            direcciontxt.Text = cliente1.DIREC1;
            telefonotxt.Text = cliente1.TELEF1;
            telefono2txt.Text = cliente1.TELEF2;
            trabajotxt.Text = cliente1.RAZON;
            trabajodirtxt.Text = cliente1.DIREC2;
            loadZona();
            capitallb.Text = String.Format("{0:C}", cliente1.CAPITAL);
            actuallb.Text = String.Format("{0:C}", cliente1.ACTUAL);
            interestlb.Text = String.Format("{0:C}", cliente1.INTERES);
            totallb.Text = String.Format("{0:C}", cliente1.CAPITAL + cliente1.INTERES);
            moralb.Text = "$0.00";

            // String.Format("Order Total: {0:C}", moneyvalue);
            foreach (string prestamo in cliente1.Prestamo.Actuales)
            {
                prestamocb.Items.Add(prestamo);
            }

            // only select if person has prestamo.
            if (prestamocb.Items.Count > 0)
            {
                prestamocb.SelectedIndex = 0;
            }

            // load historia de prestamo de cliente
            DataTable dt = cliente1.prestamoListaHistoria();

            FillList(this.clientehistoriaprestamolist, dt);

            // load cliente recibos
            loadRecibos();
        }
Exemplo n.º 8
0
        private void grabarBtn_Click(object sender, EventArgs e)
        {
            cl = new Cliente(Codigo);
            string cuotastr = "";// cplistEx.SelectedItems[0].SubItems[5].Text;

            for (int i = 0; i < m_recibo_list.Items.Count; i++)
            {
                cuotastr = m_recibo_list.Items[i].SubItems[0].Text;
                string capitaltmp = m_recibo_list.Items[i].SubItems[3].Text;
                string interestmp = m_recibo_list.Items[i].SubItems[4].Text;
                string moratmp = m_recibo_list.Items[i].SubItems[5].Text;
                double capitalstr = 0.00;
                double interesstr = 0.00;
                double morastr = 0.00;

                if (capitaltmp != "")
                {
                    capitalstr = Double.Parse(capitaltmp);
                }

                if (interestmp != "")
                {
                    interesstr = Double.Parse(interestmp);
                }
                if (moratmp != "")
                {
                    morastr = Double.Parse(moratmp);
                }

                if (i == 0)
                {
                    cl.Prestamo.modificarPagares(ReciboID, PrestamoID, cuotastr, capitalstr, interesstr, morastr);
                }
                else
                {
                    // add the 2nd pagare
                   cl.Prestamo.modificarPagaresUpdate(ReciboID, PrestamoID, cuotastr, capitalstr, interesstr, morastr);
                }
                this.Close();

            }
        }
Exemplo n.º 9
0
        private void loadIngresoAno()
        {
            string todaymes = DateTime.Now.ToString("yyyy-01-01");
            string today = DateTime.Now.ToString("yyyy-MM-dd");
            Cliente c = new Cliente();

            SqlDataReader ingreso = c.IngresoMensualSuma(todaymes, today);
            //populate total

            if (ingreso.Read())
            {
                double capitalstr = 0.00;
                double interesstr = 0.00;
                double morastr = 0.00;
                double t = 0.00;

                if (ingreso["Capital"].ToString() != "")
                {
                    capitalstr = Double.Parse(ingreso["Capital"].ToString());
                }
                if (ingreso["Interes"].ToString() != "")
                {
                    interesstr = Double.Parse(ingreso["Interes"].ToString());
                }
                if (ingreso["Mora"].ToString() != "")
                {
                    morastr = Double.Parse(ingreso["Mora"].ToString());
                }
                anocapitallb.Text = String.Format("{0:N}", capitalstr);
                anointereslb.Text = String.Format("{0:N}", interesstr);
                anomoralb.Text = String.Format("{0:N}", morastr);

                t = capitalstr + interesstr + morastr;
                anototallb.Text = String.Format("{0:N}", t);
            }
            ingreso.Close();
        }
Exemplo n.º 10
0
        private void cl_grabarbtn_Click(object sender, EventArgs e)
        {
            if (cl_nombretxt.Text != "" && cl_codigotxt.Text != "")
            {
                Cliente c = new Cliente();
                c.CODIGO = cl_codigotxt.Text;
                c.NOMBRE = cl_nombretxt.Text.ToUpper();
                c.DIREC1 = cl_direccion.Text.ToUpper();
                c.TELEF1 = cl_telefonotxt.Text;
                c.RAZON = cl_trabajotxt.Text.ToUpper();
                c.DIREC2 = cl_trabajo_dirtxt.Text.ToUpper();
                c.TELEF2 = cl_trabajo_teltxt.Text;
                c.Z_CODIGO = zonacb.SelectedValue.ToString();
                c.CEDULA = cl_cedulatxt.Text;
                //no. pasaporto.

                c.createClienteNuevo();
                MessageBox.Show("Cliente Grabado");
                //clear form after it was successfully saved to database
                cl_codigotxt.Text = "";
                cl_nombretxt.Text = "";
                cl_direccion.Text = "";
                cl_telefonotxt.Text = "";
                cl_trabajotxt.Text = "";
                cl_trabajo_dirtxt.Text = "";
                cl_trabajo_teltxt.Text = "";

                cl_cedulatxt.Text = "";
            }
            else
            {
                MessageBox.Show("Favor de entrar nombre del cliente y  codigo.",
                                "Error ",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
            }
        }
Exemplo n.º 11
0
        private void loadPrestamoMes()
        {
            string todaymes = DateTime.Now.ToString("yyyy-MM-01");
            string today = DateTime.Now.ToString("yyyy-MM-dd");
            Cliente c = new Cliente();

            SqlDataReader ingreso = c.PrestamoMensualSuma(todaymes, today);
            //populate total

            if (ingreso.Read())
            {
                double totalsum = 0.00;

                if (ingreso["totalsum"].ToString() != "")
                {
                    totalsum = Double.Parse(ingreso["totalsum"].ToString());
                }

                pmesCantidadlb.Text = String.Format("{0:N}", totalsum);
                pmesCuentalb.Text = String.Format("{0:N}", ingreso["totalcount"].ToString());

            }
            ingreso.Close();
        }
Exemplo n.º 12
0
 private void reportebtn_Click(object sender, EventArgs e)
 {
     Cliente c = new Cliente();
     DataTable dt = c.ClienteListaHoy(fechacal.SelectionStart.ToString("yyyy-MM-dd"));
     // clienteListalv. = dt;
     FillList(this.m_list, dt);
 }