public DataSet GetAll(string empresaid, tb_me_asistquinplanilla BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbMeVendedorAsisquin_PLANTILLA", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@perianio", SqlDbType.Char, 4).Value = BE.perianio;
                 cmd.Parameters.Add("@perimes", SqlDbType.Char, 2).Value = BE.perimes;
                 cmd.Parameters.Add("@quincena", SqlDbType.Char, 1).Value = BE.quincena;
                 //cmd.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                 //cmd.Parameters.Add("@cargoid", SqlDbType.Char, 3).Value = BE.cargoid;
                 //cmd.Parameters.Add("@cateplanid", SqlDbType.Char, 1).Value = BE.cateplanid;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public DataSet GetAll_paginacion(string empresaid, tb_me_asistquinplanilla BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 //cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 //cmd.Parameters.Add("@lineaid", SqlDbType.Char, 3).Value = BE.lineaid;
                 //cmd.Parameters.Add("@posicion", SqlDbType.VarChar, 10).Value = BE.posicion;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public bool Delete(string empresaid, tb_me_asistquinplanilla BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 //cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 //cmd.Parameters.Add("@lineaid", SqlDbType.Char, 3).Value = BE.lineaid;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
        public bool Update(string empresaid, tb_me_asistquinplanilla BE)
        {
            using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
            {
                using (SqlCommand cmd = new SqlCommand("", cnx))
                {

                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        //cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                        //cmd.Parameters.Add("@lineaid", SqlDbType.Char, 3).Value = BE.lineaid;
                        //cmd.Parameters.Add("@lineaname", SqlDbType.VarChar, 20).Value = BE.lineaname;
                        //cmd.Parameters.Add("@estructuraid", SqlDbType.Char, 1).Value = BE.estructuraid;
                        //cmd.Parameters.Add("@usuar", SqlDbType.Char, 15).Value = BE.usuar;
                        //cmd.Parameters.Add("@nostock", SqlDbType.Bit).Value = BE.nostock;
                    }
                    try
                    {
                        cnx.Open();
                        if (cmd.ExecuteNonQuery() > 0)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                    finally
                    {
                        cnx.Close();
                    }
                }
            }
        }
        private void Data_TablaAsistQuinPlanilla()
        {
            try
            {
                TablaAsistQuinPlanilla = new DataTable();

                if (TablaAsistQuinPlanilla.Rows.Count > 0)
                {
                    TablaAsistQuinPlanilla.Rows.Clear();
                }
                var BL = new tb_me_asistquinplanillaBL();
                var BE = new tb_me_asistquinplanilla();

                if (cmb_perianio.SelectedIndex != -1 && cmb_perianio.Text.Length == 4 )
                {
                    BE.perianio = cmb_perianio.SelectedValue.ToString();
                }
                if (cmb_perimes2.SelectedIndex != -1 && cmb_perimes2.SelectedIndex > 0)
                {
                    BE.perimes = cmb_perimes2.SelectedValue.ToString();
                }
                if (cmb_quincena.SelectedIndex != -1 && cmb_quincena.Text.Length == 1)
                {
                    BE.quincena = cmb_quincena.Text.ToString().Trim();
                }

                TablaAsistQuinPlanilla = BL.GetAll(EmpresaID, BE).Tables[0];
                if (TablaAsistQuinPlanilla.Rows.Count > 0)
                {
                    MDI_dgb_planillacomision.DataSource = TablaAsistQuinPlanilla;
                }
                else
                {
                    MDI_dgb_planillacomision.DataSource = TablaAsistQuinPlanilla;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
 public bool Update(string empresaid, tb_me_asistquinplanilla BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
 public bool Insert(string empresaid, tb_me_asistquinplanilla BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
 public DataSet GetOne(string empresaid, tb_me_asistquinplanilla BE)
 {
     return tablaDA.GetOne(empresaid, BE);
 }
 public DataSet GetAll_paginacion(string empresaid, tb_me_asistquinplanilla BE)
 {
     return tablaDA.GetAll_paginacion(empresaid, BE);
 }