public bool Delete(string empresaid, tb_sys_tienda BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbSysTienda_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@dominioid", SqlDbType.Char, 2).Value = BE.dominioid;
                 cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 cmd.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public DataSet GetAll(string empresaid, tb_sys_tienda BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbSysTienda_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@dominioid", SqlDbType.Char, 2).Value = BE.dominioid;
                 cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 cmd.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                 cmd.Parameters.Add("@ctacte", SqlDbType.Char, 7).Value = BE.ctacte;
                 cmd.Parameters.Add("@nmruc", SqlDbType.Char, 11).Value = BE.nmruc;
                 cmd.Parameters.Add("@ctactename", SqlDbType.VarChar, 70).Value = BE.ctactename;
                 cmd.Parameters.Add("@direcnume", SqlDbType.Char, 3).Value = BE.direcnume;
                 cmd.Parameters.Add("@direcname", SqlDbType.VarChar, 50).Value = BE.direcname;
                 cmd.Parameters.Add("@direcdeta", SqlDbType.VarChar, 100).Value = BE.direcdeta;
             }
             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_new(string empresaid, tb_sys_tienda BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbSysTienda_SEARCH_new", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@dominioid", SqlDbType.Char, 2).Value = BE.dominioid;
                 cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
        public bool Update(string empresaid, tb_sys_tienda BE)
        {
            using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
            {
                using (SqlCommand cmd = new SqlCommand("gspTbSysTienda_UPDATE", cnx))
                {

                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.Add("@dominioid", SqlDbType.Char, 2).Value = BE.dominioid;
                        cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                        cmd.Parameters.Add("@local", SqlDbType.Char, 3).Value = BE.local;
                        cmd.Parameters.Add("@ctacte", SqlDbType.Char, 7).Value = BE.ctacte;
                        cmd.Parameters.Add("@nmruc", SqlDbType.Char, 11).Value = BE.nmruc;
                        cmd.Parameters.Add("@ctactename", SqlDbType.VarChar, 70).Value = BE.ctactename;
                        cmd.Parameters.Add("@direcnume", SqlDbType.Char, 3).Value = BE.direcnume;
                        cmd.Parameters.Add("@direcname", SqlDbType.VarChar, 50).Value = BE.direcname;
                        cmd.Parameters.Add("@direcdeta", SqlDbType.VarChar, 100).Value = BE.direcdeta;
                    }
                    try
                    {
                        cnx.Open();
                        if (cmd.ExecuteNonQuery() > 0)
                        {
                            return true;
                        }
                        else
                        {
                            return false;
                        }
                    }
                    catch (Exception ex)
                    {
                        throw new Exception(ex.Message);
                    }
                }
            }
        }