Exemplo n.º 1
0
 public DataTable fetch(BanProp p)
 {
     try
     {
         con.Open();
         SqlCommand cmd = new SqlCommand("bannerSP", con);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@tag", p._tag);
         cmd.Parameters.AddWithValue("@Banner_ID", p._Banner_ID);
         cmd.Parameters.AddWithValue("@Pos", p._Pos);
         cmd.Parameters.AddWithValue("@Name", p._Name);
         cmd.Parameters.AddWithValue("@Link", p._Link);
         SqlDataAdapter da = new SqlDataAdapter(cmd);
         DataTable      dt = new DataTable();
         da.Fill(dt);
         return(dt);
     }
     catch (Exception e)
     {
         con.Close();
         return(null);
     }
     finally
     {
         con.Close();
     }
 }
Exemplo n.º 2
0
 public DataTable fetchBal(BanProp pr)
 {
     try
     {
         BanDal dal = new BanDal();
         return(dal.fetch(pr));
     }
     catch (Exception e)
     {
         return(null);
     }
 }
Exemplo n.º 3
0
 public int AddBal(BanProp pr)
 {
     try
     {
         BanDal dal = new BanDal();
         return(dal.Add(pr));
     }
     catch (Exception e)
     {
         return(0);
     }
 }
Exemplo n.º 4
0
 public int Add(BanProp p)
 {
     try
     {
         con.Open();
         SqlCommand cmd = new SqlCommand("bannerSP", con);
         cmd.CommandType = CommandType.StoredProcedure;
         cmd.Parameters.AddWithValue("@tag", p._tag);
         cmd.Parameters.AddWithValue("@Banner_ID", p._Banner_ID);
         cmd.Parameters.AddWithValue("@Pos", p._Pos);
         cmd.Parameters.AddWithValue("@Name", p._Name);
         cmd.Parameters.AddWithValue("@Link", p._Link);
         return(cmd.ExecuteNonQuery());
     }
     catch (Exception e)
     {
         con.Close();
         return(0);
     }
     finally
     {
         con.Close();
     }
 }