コード例 #1
0
        private void genReporte(string sdate, string edate)
        {
            Reportes  re = new Reportes();
            DataTable dt = re.GastosOperacionalesReporte(sdate, edate);

            int[] colSize = { 60, 70, 200, 240, 70 };
            FillList(this.m_list, dt, colSize);
        }
コード例 #2
0
        private void genReporte(string sdate, string edate)
        {
            Reportes  re = new Reportes();
            DataTable dt = re.CuotasPendientesReporte(sdate, edate);

            int[]       colSize    = { 80, 180, 70, 60 };
            LlenarLista listaLLena = new LlenarLista(this.m_list, dt, colSize);

            SqlDataReader ingreso = re.CuotasPendientesReporteSUMA(sdate, edate);

            ////populate total
            this.m_list.SuspendLayout();
            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["BCAPITAL"].ToString()); //mora
                item.SubItems.Add(ingreso["Interes"].ToString());  //interes
                item.SubItems.Add(ingreso["BInteres"].ToString()); //interes

                double capitalstr  = 0.00;
                double interesstr  = 0.00;
                double bcapitalstr = 0.00;
                double binteresstr = 0.00;

                if (ingreso["Capital"].ToString() != "")
                {
                    capitalstr = Double.Parse(ingreso["Capital"].ToString());
                }
                if (ingreso["BCapital"].ToString() != "")
                {
                    bcapitalstr = Double.Parse(ingreso["BCapital"].ToString());
                }
                if (ingreso["Interes"].ToString() != "")
                {
                    interesstr = Double.Parse(ingreso["Interes"].ToString());
                }
                if (ingreso["BInteres"].ToString() != "")
                {
                    binteresstr = Double.Parse(ingreso["BInteres"].ToString());
                }


                capitallabel.Text  = String.Format("{0:C}", capitalstr);
                bcapitallabel.Text = String.Format("{0:C}", bcapitalstr);
                interestlabel.Text = String.Format("{0:C}", interesstr);
                bintereslabel.Text = String.Format("{0:C}", binteresstr);
            }
            this.m_list.Items.Add(item);
            this.m_list.ResumeLayout();
        }
コード例 #3
0
        public void ProcesarCuotas(string pid, string fecha,bool domora)
        {
            Reportes re = new Reportes();
            DataSet ds = new DataSet();
            SqlDataAdapter adapter = re.getPrestamoMoraCuotas(fecha, pid);
            adapter.Fill(ds);

            double totalmora = 0;
            double capven = 0;
            double intven = 0;
            int counter = 1;
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                ListViewItem item = new ListViewItem();
                item.Text = row["HISTORIAID"].ToString();
                item.SubItems.Add(row["PRESTAMOID"].ToString());
                item.SubItems.Add(row["Cuota"].ToString());
                item.SubItems.Add(row["CL_CODIGO"].ToString());
                item.SubItems.Add(row["CL_NOMBRE"].ToString());
                item.SubItems.Add(row["Capital"].ToString());
                double mora = 0;
                double interes = 0;

                if (Double.TryParse(row["Capital"].ToString(), out mora))
                {
                    capven += mora;
                    mora = Math.Floor(mora * 0.05);
                    totalmora += mora;

                    item.SubItems.Add(mora.ToString());

                }

                if (Double.TryParse(row["Interes"].ToString(), out interes))
                {
                    intven += interes;

                }

                if (domora)
                {

                     re.setUpdateCuotaMora(row["HISTORIAID"].ToString(), mora);
                    actualizarBackgroundWorker1.ReportProgress(counter, item);

                }
                counter++;
            }

            if (domora)
            {

                re.setUpdatePrestamoMora(pid, totalmora);
            }

            re.setUpdatePrestamoCapVen(pid, capven, intven);
        }
コード例 #4
0
        private void reportebtn_Click(object sender, EventArgs e)
        {
            Reportes  re = new Reportes();
            DataTable dt = re.DataCreditoReporte();

            int[]       colSize    = { 80, 80, 200, 150, 80, 80 };
            LlenarLista listaLLena = new LlenarLista(this.dc_list, dt, colSize, "DATACREDITO");

            loaded = true;
        }
コード例 #5
0
        private void genReporte(string sdate, string edate)
        {
            Reportes re = new Reportes();
            DataTable dt = re.CuotasPendientesReporte(sdate, edate);

            int[] colSize = {80,180,70,60};
            LlenarLista listaLLena = new LlenarLista(this.m_list,dt,colSize);

            SqlDataReader ingreso = re.CuotasPendientesReporteSUMA(sdate, edate);
            ////populate total
            this.m_list.SuspendLayout();
            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["BCAPITAL"].ToString()); //mora
                item.SubItems.Add(ingreso["Interes"].ToString()); //interes
                item.SubItems.Add(ingreso["BInteres"].ToString()); //interes

                double capitalstr = 0.00;
                double interesstr = 0.00;
                double bcapitalstr = 0.00;
                double binteresstr = 0.00;

                if (ingreso["Capital"].ToString() != "")
                {
                    capitalstr = Double.Parse(ingreso["Capital"].ToString());
                }
                if (ingreso["BCapital"].ToString() != "")
                {
                    bcapitalstr = Double.Parse(ingreso["BCapital"].ToString());
                }
                if (ingreso["Interes"].ToString() != "")
                {
                    interesstr = Double.Parse(ingreso["Interes"].ToString());
                }
                if (ingreso["BInteres"].ToString() != "")
                {
                    binteresstr = Double.Parse(ingreso["BInteres"].ToString());
                }

                capitallabel.Text = String.Format("{0:C}", capitalstr);
                bcapitallabel.Text = String.Format("{0:C}", bcapitalstr);
                interestlabel.Text = String.Format("{0:C}", interesstr);
                bintereslabel.Text = String.Format("{0:C}", binteresstr);
            }
            this.m_list.Items.Add(item);
            this.m_list.ResumeLayout();
        }
コード例 #6
0
        public void ProcesarCuotas(string pid, string fecha, bool domora)
        {
            Reportes       re      = new Reportes();
            DataSet        ds      = new DataSet();
            SqlDataAdapter adapter = re.getPrestamoMoraCuotas(fecha, pid);

            adapter.Fill(ds);

            double totalmora = 0;
            double capven    = 0;
            double intven    = 0;
            int    counter   = 1;

            foreach (DataRow row in ds.Tables[0].Rows)
            {
                ListViewItem item = new ListViewItem();
                item.Text = row["HISTORIAID"].ToString();
                item.SubItems.Add(row["PRESTAMOID"].ToString());
                item.SubItems.Add(row["Cuota"].ToString());
                item.SubItems.Add(row["CL_CODIGO"].ToString());
                item.SubItems.Add(row["CL_NOMBRE"].ToString());
                item.SubItems.Add(row["Capital"].ToString());
                double mora    = 0;
                double interes = 0;

                if (Double.TryParse(row["Capital"].ToString(), out mora))
                {
                    capven    += mora;
                    mora       = Math.Floor(mora * 0.05);
                    totalmora += mora;

                    item.SubItems.Add(mora.ToString());
                }

                if (Double.TryParse(row["Interes"].ToString(), out interes))
                {
                    intven += interes;
                }

                if (domora)
                {
                    re.setUpdateCuotaMora(row["HISTORIAID"].ToString(), mora);
                    actualizarBackgroundWorker1.ReportProgress(counter, item);
                }
                counter++;
            }

            if (domora)
            {
                re.setUpdatePrestamoMora(pid, totalmora);
            }

            re.setUpdatePrestamoCapVen(pid, capven, intven);
        }
コード例 #7
0
        private void dc_list_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (loaded)
            {
                //setUpdateDataCredito
                int indexnum = e.Index;
                int num = 0;
                string pid = dc_list.Items[indexnum].SubItems[0].Text;

                if (e.NewValue == CheckState.Checked)
                {
                    num = 1;
                }
                Reportes re = new Reportes();
                re.setUpdateDataCredito(pid, num);
            }
        }
コード例 #8
0
        private void dc_list_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            if (loaded)
            {
                //setUpdateDataCredito
                int    indexnum = e.Index;
                int    num      = 0;
                string pid      = dc_list.Items[indexnum].SubItems[0].Text;

                if (e.NewValue == CheckState.Checked)
                {
                    num = 1;
                }
                Reportes re = new Reportes();
                re.setUpdateDataCredito(pid, num);
            }
        }
コード例 #9
0
        private void genReporte(string sdate, string edate)
        {
            Reportes  re = new Reportes();
            DataTable dt = re.BalanceClienteReporte();

            int[]       colSize    = { 100, 350, 100 };
            LlenarLista listaLLena = new LlenarLista(this.m_list, dt, colSize);

            SqlDataReader ingreso = re.BalanceClienteReporteSUMA();

            ////populate total
            this.m_list.SuspendLayout();
            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

                double capitalstr  = 0.00;
                double interesstr  = 0.00;
                double bcapitalstr = 0.00;
                double binteresstr = 0.00;

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



                capitallabel.Text = String.Format("{0:C}", capitalstr);
            }
            this.m_list.Items.Add(item);
            this.m_list.ResumeLayout();
        }
コード例 #10
0
        private void genReporte(string sdate, string edate)
        {
            Reportes re = new Reportes();
            DataTable dt = re.BalanceClienteReporte();

            int[] colSize = { 100, 350, 100 };
            LlenarLista listaLLena = new LlenarLista(this.m_list, dt, colSize);

            SqlDataReader ingreso = re.BalanceClienteReporteSUMA();
            ////populate total
            this.m_list.SuspendLayout();
            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

                double capitalstr = 0.00;
                double interesstr = 0.00;
                double bcapitalstr = 0.00;
                double binteresstr = 0.00;

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

                capitallabel.Text = String.Format("{0:C}", capitalstr);

            }
            this.m_list.Items.Add(item);
            this.m_list.ResumeLayout();
        }
コード例 #11
0
        private void genReporte(string sdate, string edate)
        {
            Reportes re = new Reportes();
            DataTable dt = re.GastosOperacionalesReporte(sdate, edate);

            int[] colSize = { 60, 70, 200, 240,70 };
            FillList(this.m_list, dt, colSize);
        }
コード例 #12
0
        private void reportebtn_Click(object sender, EventArgs e)
        {
            Reportes re = new Reportes();
            DataTable dt = re.DataCreditoReporte();

            int[] colSize = { 80,80,200, 150, 80,80 };
            LlenarLista listaLLena = new LlenarLista(this.dc_list, dt, colSize,"DATACREDITO");
            loaded = true;
        }
コード例 #13
0
        private void actualizarBackgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            Reportes re = new Reportes();

            //set all capven and intven to 0
            re.UpdateAllPrestamoCapVen();

            // procesar semanales primero.
            if ( semanalTexBox.Text != "")
            {
                double dia = -1 * Double.Parse(semanalTexBox.Text);
                DateTime hoy = DateTime.Now.AddDays(dia);
                DataSet ds = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "S");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(),hoy.ToString("yyyy-MM-dd"),semanalCheckBox.Checked);

                    counter++;
                }

            }

            if (diarioTextBox.Text != "")
            {
                double dia = -1 * Double.Parse(diarioTextBox.Text);
                DateTime hoy = DateTime.Now.AddDays(dia);
                DataSet ds = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "D");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(), hoy.ToString("yyyy-MM-dd"),diarioCheckBox.Checked);

                    counter++;
                }

            }

            if (quincenalTexBox.Text != "")
            {
                double dia = -1 * Double.Parse(quincenalTexBox.Text);
                DateTime hoy = DateTime.Now.AddDays(dia);
                DataSet ds = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "Q");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(), hoy.ToString("yyyy-MM-dd"), quincenalCheckBox.Checked);

                    counter++;
                }

            }

            if (mensualTexBox.Text != "")
            {
                int dia = -1 * int.Parse(mensualTexBox.Text);
                DateTime hoy = DateTime.Now.AddDays(dia);
                DataSet ds = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "M");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(), hoy.ToString("yyyy-MM-dd"), mensualCheckBox.Checked);

                    counter++;
                }

            }
        }
コード例 #14
0
        private void actualizarBackgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            Reportes re = new Reportes();

            //set all capven and intven to 0
            re.UpdateAllPrestamoCapVen();

            // procesar semanales primero.
            if (semanalTexBox.Text != "")
            {
                double         dia     = -1 * Double.Parse(semanalTexBox.Text);
                DateTime       hoy     = DateTime.Now.AddDays(dia);
                DataSet        ds      = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "S");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(), hoy.ToString("yyyy-MM-dd"), semanalCheckBox.Checked);


                    counter++;
                }
            }

            if (diarioTextBox.Text != "")
            {
                double         dia     = -1 * Double.Parse(diarioTextBox.Text);
                DateTime       hoy     = DateTime.Now.AddDays(dia);
                DataSet        ds      = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "D");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(), hoy.ToString("yyyy-MM-dd"), diarioCheckBox.Checked);


                    counter++;
                }
            }

            if (quincenalTexBox.Text != "")
            {
                double         dia     = -1 * Double.Parse(quincenalTexBox.Text);
                DateTime       hoy     = DateTime.Now.AddDays(dia);
                DataSet        ds      = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "Q");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(), hoy.ToString("yyyy-MM-dd"), quincenalCheckBox.Checked);


                    counter++;
                }
            }

            if (mensualTexBox.Text != "")
            {
                int            dia     = -1 * int.Parse(mensualTexBox.Text);
                DateTime       hoy     = DateTime.Now.AddDays(dia);
                DataSet        ds      = new DataSet();
                SqlDataAdapter adapter = re.getPrestamoMoraList(hoy.ToString("yyyy-MM-dd"), "M");
                adapter.Fill(ds);

                int counter = 1;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    ProcesarCuotas(row["PRESTAMO"].ToString(), hoy.ToString("yyyy-MM-dd"), mensualCheckBox.Checked);



                    counter++;
                }
            }
        }