public bool Insert(string empresaid, tb_pp_servcorte BE)
        {
            using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
            {
                using (SqlCommand cmd = new SqlCommand("", cnx))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.Add("@servcortename", SqlDbType.Char, 30).Value = BE.servcortename;

                    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_pp_servcorte BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbServCorte_SEARCH", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@servcorteid", SqlDbType.Char, 2).Value = BE.servcorteid;
                 cmd.Parameters.Add("@servcortename", SqlDbType.Char, 30).Value = BE.servcortename;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
        void ValidaServicio()
        {
            tb_pp_servcorte BE = new tb_pp_servcorte();
            tb_pp_servcorteBL BL = new tb_pp_servcorteBL();
            DataTable dt = new DataTable();
            BE.servcorteid = txt_servcorteid.Text;
            BE.servcortename = txt_servcortename.Text;

            try
            {
                dt = BL.GetAll(EmpresaID, BE).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    txt_servcorteid.Text = dt.Rows[0]["servcorteid"].ToString();
                    txt_servcortename.Text = dt.Rows[0]["servcortename"].ToString();
                }
                else
                {
                    txt_servcorteid.Text = "";
                    txt_servcortename.Text = "";
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 public bool Update(string empresaid, tb_pp_servcorte BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
 public bool Insert(string empresaid, tb_pp_servcorte BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
 public DataSet GetAll(string empresaid, tb_pp_servcorte BE)
 {
     return tablaDA.GetAll(empresaid, BE);
 }