Beispiel #1
0
 protected void Button2_Click(object sender, EventArgs e)
 {
     T_ad_img mo = new T_ad_img();
     mo.Path_img3 = img(FileUpload3, 3);
     if (DAL.ad_main.admin_in_img(mo,3) > 0)
     {
         MessShowBox.show("添加成功", this);
     }
     else
     {
         MessShowBox.show("添加失败", this);
     }
 }
Beispiel #2
0
 protected void butsubmint_Click(object sender, EventArgs e)
 {
     T_ad_img mo = new T_ad_img();
     mo.Path_img1 = img(FileUpload1, 1);
     if (DAL.ad_main.admin_in_img(mo,1) > 0)
     {
         MessShowBox.show("添加成功", this);
     }
     else
     {
         MessShowBox.show("添加失败", this);
     }
 }
Beispiel #3
0
 public static T_ad_img user_se_ad_img()
 {
     string sql = "select * from t_ad_img  order by id desc";
     using (SqlDataReader dr = a.data.mssql.ExecuteReader(0, sql))
     {
         T_ad_img model = null;
         while (dr.Read())
         {
             model = new T_ad_img();
             model.Id = a.normal.toInt(dr["id"]);
             model.Path_img1 = a.normal.toString(dr["Path_img1"]);
             model.Path_img2 = a.normal.toString(dr["Path_img2"]);
             model.Path_img3 = a.normal.toString(dr["Path_img3"]);
             model.Path_img4 = a.normal.toString(dr["Path_img4"]);
             model.Path_img5 = a.normal.toString(dr["Path_img5"]);
         }
         dr.Close();
         dr.Dispose();
         return model;
     }
 }
Beispiel #4
0
 public static T_ad_img admin_select_img()
 {
     using (SqlDataReader dr = a.data.mssql.ExecuteReader(0, "select * from t_ad_img"))
     {
         T_ad_img img = null;
         while (dr.Read())
         {
             img = new T_ad_img();
             img.Path_img1 = a.normal.toString(dr["Path_img1"]);
             img.Path_img2 = a.normal.toString(dr["Path_img2"]);
             img.Path_img3 = a.normal.toString(dr["Path_img3"]);
             img.Path_img4 = a.normal.toString(dr["Path_img4"]);
             img.Path_img5 = a.normal.toString(dr["Path_img5"]);
         }
         dr.Close();
         dr.Dispose();
         return img;
     }
 }
Beispiel #5
0
 public static int admin_in_img(T_ad_img model, int i)
 {
     int k = 0;
     if (i == 1)
     {
         string sql = @"update  t_ad_img  set path_img1=@path_img1 where id=1";
         k = a.data.mssql.ExecuteNonQuery(0, sql, new SqlParameter[] { new SqlParameter("@path_img1", model.Path_img1) });
     }
     else if (i == 2)
     {
         string sql = @"update  t_ad_img  set path_img2=@path_img2 where id=1";
         k = a.data.mssql.ExecuteNonQuery(0, sql, new SqlParameter[] { new SqlParameter("@path_img2", model.Path_img2) });
     }
     else if (i == 3)
     {
         string sql = @"update  t_ad_img  set path_img3=@path_img3 where id=1";
         k = a.data.mssql.ExecuteNonQuery(0, sql, new SqlParameter[] { new SqlParameter("@path_img3", model.Path_img3) });
     }
     else if (i == 4)
     {
         string sql = @"update  t_ad_img  set path_img4=@path_img4 where id=1";
         k = a.data.mssql.ExecuteNonQuery(0, sql, new SqlParameter[] { new SqlParameter("@path_img4", model.Path_img4) });
     }
     else if (i == 5)
     {
         string sql = @"update  t_ad_img  set path_img5=@path_img5 where id=1";
         k = a.data.mssql.ExecuteNonQuery(0, sql, new SqlParameter[] { new SqlParameter("@path_img5", model.Path_img5) });
     }
     return k;
 }