Beispiel #1
0
 public int eliminarImss(Imss i)
 {
     Command.CommandText = "delete from tablaImss where id = @id";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("id", i.id);
     return Command.ExecuteNonQuery();
 }
Beispiel #2
0
 public decimal CuotaObreroPatronal(Imss i)
 {
     Command.CommandText = @"select sum(porcentaje) from tablaImss where secalcula = @secalcula";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("secalcula", i.secalcula);
     decimal suma = decimal.Parse(Select(Command).ToString());
     return suma;
 }
Beispiel #3
0
 public int insertaImss(Imss i)
 {
     Command.CommandText = "insert into tablaImss (prestacion, porcentaje, secalcula) values (@prestacion, @porcentaje, @secalcula)";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("prestacion", i.prestacion);
     Command.Parameters.AddWithValue("porcentaje", i.porcentaje);
     Command.Parameters.AddWithValue("secalcula", i.secalcula);
     return Command.ExecuteNonQuery();
 }
Beispiel #4
0
 public int actualizaImss(Imss i)
 {
     Command.CommandText = "update tablaImss set prestacion = @prestacion, porcentaje = @porcentaje, secalcula = @secalcula where id = @id";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("id", i.id);
     Command.Parameters.AddWithValue("prestacion", i.prestacion);
     Command.Parameters.AddWithValue("porcentaje", i.porcentaje);
     Command.Parameters.AddWithValue("secalcula", i.secalcula);
     return Command.ExecuteNonQuery();
 }
Beispiel #5
0
 public List<Imss> ObtenerImss()
 {
     List<Imss> lstImss = new List<Imss>();
     DataTable dtImss = new DataTable();
     Command.CommandText = "select * from tablaImss";
     dtImss = SelectData(Command);
     for (int i = 0; i < dtImss.Rows.Count; i++)
     {
         Imss imss = new Imss();
         imss.id = int.Parse(dtImss.Rows[i]["id"].ToString());
         imss.prestacion = dtImss.Rows[i]["prestacion"].ToString();
         imss.porcentaje = decimal.Parse(dtImss.Rows[i]["porcentaje"].ToString());
         imss.secalcula = bool.Parse(dtImss.Rows[i]["secalcula"].ToString());
         lstImss.Add(imss);
     }
     return lstImss;
 }
Beispiel #6
0
        private void Calcular_Click(object sender, EventArgs e)
        {
            double Aguinaldo, Vacaciones, Prima, Infonavit, Imss, Rcv;
            double Sgmm, Sgmmd, Vales, Comedor, Seguro, Personal, Sick;
            double Saldo, Ley, Empresa, Total;

            Aguinaldo  = (Convert.ToDouble(aguinaldo.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Vacaciones = (Convert.ToDouble(vacaciones.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Prima      = (Convert.ToDouble(prima.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Infonavit  = (Convert.ToDouble(infonavit.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Imss       = (Convert.ToDouble(imss.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Rcv        = (Convert.ToDouble(rcv.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Sgmm       = (Convert.ToDouble(sgmm.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Sgmmd      = Sgmm * (Convert.ToDouble(dependents.Text));
            Vales      = (Convert.ToDouble(vales.Text) * (Convert.ToDouble(saldo1.Text))) / 100;
            Comedor    = Convert.ToDouble(comedor.Text);
            Seguro     = Convert.ToDouble(seguro.Text);
            Personal   = Convert.ToDouble(personal.Text);
            Sick       = Convert.ToDouble(sick.Text);

            aguinaldo2.Text  = Aguinaldo.ToString("C");
            vacaciones2.Text = Vacaciones.ToString("C");
            prima2.Text      = Prima.ToString("C");
            infonavit2.Text  = Infonavit.ToString("C");
            imss2.Text       = Imss.ToString("C");
            rcv2.Text        = Rcv.ToString("C");
            sgmm2.Text       = Sgmm.ToString("C");
            sgmmd2.Text      = Sgmmd.ToString("C");
            vales2.Text      = Vales.ToString("C");
            comedor2.Text    = Comedor.ToString("C");
            seguro2.Text     = Seguro.ToString("C");
            personal2.Text   = Personal.ToString("C");
            sick2.Text       = Sick.ToString("C");

            Saldo   = Convert.ToDouble(saldo1.Text);
            Ley     = Aguinaldo + Vacaciones + Prima + Infonavit + Imss + Rcv;
            Empresa = Sgmm + Sgmmd + Vales + Comedor + Seguro + Personal + Sick;;
            Total   = Saldo + Empresa + Ley;

            saldo2.Text  = Saldo.ToString("C");
            ley.Text     = Ley.ToString("C");
            empresa.Text = Empresa.ToString("C");
            total.Text   = Total.ToString("C");
        }
Beispiel #7
0
 public List<Imss> ObtenerImss(Imss i)
 {
     List<Imss> lstImss = new List<Imss>();
     DataTable dtImss = new DataTable();
     Command.CommandText = "select * from tablaImss where id = @id";
     Command.Parameters.Clear();
     Command.Parameters.AddWithValue("id", i.id);
     dtImss = SelectData(Command);
     for (int j = 0; j < dtImss.Rows.Count; j++)
     {
         Imss imss = new Imss();
         imss.id = int.Parse(dtImss.Rows[j]["id"].ToString());
         imss.prestacion = dtImss.Rows[j]["prestacion"].ToString();
         imss.porcentaje = decimal.Parse(dtImss.Rows[j]["porcentaje"].ToString());
         imss.secalcula = bool.Parse(dtImss.Rows[j]["secalcula"].ToString());
         lstImss.Add(imss);
     }
     return lstImss;
 }