예제 #1
0
 //LLENAR MES EN COMBOBOX
 private void LlenarMes()
 {
     using (naf = new Nafp())
     {
         cbxmes.DataSource    = naf.Mostrar_mes();
         cbxmes.DisplayMember = "Mes";
         cbxmes.ValueMember   = "Idmes";
     }
 }
예제 #2
0
 //MOSTRAR COMISIONES ONP
 private void Fill_comisionOnp(int idmeses)
 {
     using (nafp = new Nafp())
     {
         nafp.Idmes        = idmeses;
         nafp.Idperiodo    = UserCache.Idperiodo;
         dgvonp.DataSource = nafp.Show_comisionOnp("SNP");
     }
 }
 //CARGAR AFP
 private void CargarAfps()
 {
     using (Nafp naf = new Nafp())
     {
         naf.Idmes              = PlanillaCache.p_idmes;
         naf.Idperiodo          = UserCache.Idperiodo;
         dgvcomision.DataSource = naf.Show_comisionafp("SPP");
     }
 }
예제 #4
0
        private void btnguardar_Click(object sender, EventArgs e)
        {
            if (dgvcomision.RowCount == 0)
            {
                btnguardar.Enabled = false;
                return;
            }

            using (nafp = new Nafp())
            {
                if (nafp.ListNafp == null)
                {
                    nafp.ListNafp = new List <Nafp>();
                }

                foreach (DataGridViewRow item in dgvcomision.Rows)
                {
                    nafp.ListNafp.Add(new Nafp()
                    {
                        Codigo_regimen = Convert.ToInt32(item.Cells["id_regimen"].Value),
                        Comision       = Convert.ToDecimal(item.Cells["comision"].Value),
                        Saldo          = Convert.ToDecimal(item.Cells["saldo"].Value),
                        Seguro         = Convert.ToDecimal(item.Cells["seguro"].Value),
                        Aporte         = Convert.ToDecimal(item.Cells["aporte"].Value),
                        Tope           = Convert.ToDecimal(item.Cells["tope"].Value),
                        Idmes          = Convert.ToInt32(cbomes.SelectedIndex + 1),
                        Idperiodo      = UserCache.Idperiodo
                    });
                }
                string result = nafp.SaveComision();
                // PARA ONP
                nafp.Codigo_regimen = Convert.ToInt32(dgvonp.CurrentRow.Cells["idregi"].Value);
                nafp.Comision       = Convert.ToDecimal(dgvonp.CurrentRow.Cells["onpcomision"].Value);
                nafp.Idmes          = Convert.ToInt32(cbomes.SelectedIndex + 1);
                nafp.Idperiodo      = UserCache.Idperiodo;
                string verificar = nafp.SaveOnp();
                if (!verificar.Equals(""))
                {
                    Messages.M_info(result);
                    btnguardar.Enabled = false;
                }

                nafp.ListNafp.Clear();
            }
        }
예제 #5
0
        private void btnupdate_Click(object sender, System.EventArgs e)
        {
            if (dgvcomision.RowCount == 0)
            {
                return;
            }

            using (nafp = new Nafp())
            {
                nafp.State = EntityState.Modificar;
                if (nafp.ListNafp == null)
                {
                    nafp.ListNafp = new List <Nafp>();
                }

                foreach (DataGridViewRow item in dgvcomision.Rows)
                {
                    nafp.ListNafp.Add(new Nafp()
                    {
                        Comision    = Convert.ToDecimal(item.Cells["comision"].Value),
                        Saldo       = Convert.ToDecimal(item.Cells["saldo"].Value),
                        Seguro      = Convert.ToDecimal(item.Cells["seguro"].Value),
                        Aporte      = Convert.ToDecimal(item.Cells["aporte"].Value),
                        Tope        = Convert.ToDecimal(item.Cells["tope"].Value),
                        Id_comision = Convert.ToInt32(item.Cells["id_comision"].Value)
                    });
                }
                string result = nafp.EditComision();
                //Para ONP
                nafp.Comision    = Convert.ToDecimal(dgvonp.CurrentRow.Cells["onpcomision"].Value);
                nafp.Id_comision = Convert.ToInt32(dgvonp.CurrentRow.Cells["idcomi"].Value);

                string verificar = nafp.SaveOnp();
                if (!verificar.Equals(""))
                {
                    Messages.M_info(result);
                    btnupdate.Enabled = false;
                }
                nafp.ListNafp.Clear();
                nafp.State = EntityState.Guardar;
            }
        }