Ejemplo n.º 1
0
    //添加按钮
    protected void btnadd_Click(object sender, EventArgs e)
    {
        if (this.txtphotoname.Text == null || this.txtcribe.Text == null)
        {
            { Page.ClientScript.RegisterStartupScript(typeof(string), "飞", "<script>alert(' 请输入相关信息')</script>"); }
        }
        else
        {
            model_photoalbum bum = new model_photoalbum();
            bum.photobumName  = this.txtphotoname.Text.Trim();
            bum.photobumcribe = this.txtcribe.Text.Trim();

            int a = new BLL_photoalbum().BLL_insert_photoalbum_data_ExecuteNonQuery(bum);
            if (a > 0)
            {
                Page.ClientScript.RegisterStartupScript(typeof(string), "飞", "<script>alert('添加成功')</script>");
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(typeof(string), "飞", "<script>alert('添加失败')</script>");
            }
            this.GVwMaintainPhoto.DataSource = new BLL_photoalbum().BLL_select_photoalbum_all();
            this.GVwMaintainPhoto.DataBind();
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// 向相册表中插入相册
 /// </summary>
 /// <param name="pho"></param>
 /// <returns></returns>
 public int insert_photoalbum_data_ExecuteNonQuery(model_photoalbum pho)
 {
     SqlParameter[] parm = new SqlParameter[] 
     {
         new SqlParameter ("@photobumName",pho.photobumName ),
         new SqlParameter ("@photobumcribe",pho.photobumcribe)
     };
     int a = sqlHelper.ExecuteNonQuery("insert_photoalbum_data", parm);
     return a;
 } 
Ejemplo n.º 3
0
 /// <summary>
 /// --更新相册表中数据根据相册ID
 /// </summary>
 /// <param name="pho"></param>
 /// <returns></returns>
 public int update_photoalbum_where_ID(model_photoalbum pho)
 {
     SqlParameter[] parm = new SqlParameter[] 
     {
         new  SqlParameter("@photoalbumID",pho.photoalbumID ), 
         new SqlParameter ("@photobumName",pho.photobumName ),
         new SqlParameter ("@photobumcribe",pho.photobumcribe)
     };
     int a = sqlHelper.ExecuteNonQuery("update_photoalbum_where_ID", parm);
     return a;
 } 
Ejemplo n.º 4
0
    protected void GVwMaintainPhoto_RowUpdating(object sender, GridViewUpdateEventArgs e)
    {
        model_photoalbum bum = new model_photoalbum();

        bum.photoalbumID = Convert.ToInt32(this.GVwMaintainPhoto.DataKeys[e.RowIndex].Value);
        TextBox box = GVwMaintainPhoto.Rows[e.RowIndex].Cells[0].FindControl("TextBox1") as TextBox;
        TextBox boc = GVwMaintainPhoto.Rows[e.RowIndex].Cells[0].FindControl("TextBox2") as TextBox;

        bum.photobumName  = box.Text;
        bum.photobumcribe = boc.Text;
        int a = new BLL_photoalbum().update_photoalbum_where_ID(bum);
    }
Ejemplo n.º 5
0
        /// <summary>
        /// 查询相册表中有哪些相册
        /// </summary>
        /// <returns>list集合</returns>
        public List <model_photoalbum> selcet_photoalbum_count()
        {
            List <model_photoalbum> list = new List <model_photoalbum>();
            SqlDataReader           dr   = sqlHelper.ExecuteReader("select_photoalbum_name");

            while (dr.Read())
            {
                model_photoalbum pho = new model_photoalbum();
                pho.photoalbumID = Convert.ToInt32(dr["photoalbumID"]);
                pho.photobumName = dr["photobumName"].ToString();
                list.Add(pho);
            }

            return(list);
        }
Ejemplo n.º 6
0
       /// <summary>
       /// 维护相册查询所有相册表中相册的信息
       /// </summary>
       /// <returns>List</returns>
       public List<model_photoalbum> select_photoalbum_all()
       {
           List<model_photoalbum> list = new List<model_photoalbum>();
           SqlDataReader dr = sqlHelper.ExecuteReader("select_photoalbum_all");
           while (dr.Read())
           {
               model_photoalbum me = new model_photoalbum();
               me.photoalbumID = Convert.ToInt32(dr["photoalbumID"]);
               me.photobumName = dr["photobumName"].ToString();
               me.photobumcribe = dr["photobumcribe"].ToString();
               list.Add(me);
           }
 
           return list;
       } 
Ejemplo n.º 7
0
 /// <summary>
 /// --更新相册表中数据根据相册ID
 /// </summary>
 /// <param name="pho"></param>
 /// <returns></returns>
 public int update_photoalbum_where_ID(model_photoalbum pho)
 {
     return(new DAL_photoalbum().update_photoalbum_where_ID(pho));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 向相册表中插入相册
 /// </summary>
 /// <param name="pho"></param>
 /// <returns></returns>
 public int BLL_insert_photoalbum_data_ExecuteNonQuery(model_photoalbum pho)
 {
     return(new DAL_photoalbum().insert_photoalbum_data_ExecuteNonQuery(pho));
 }