Esempio n. 1
0
        public static bool UpdatePhoto(Model.AlbumsPhotosModel model)
        {
            string sql = "Update AlbumsPhotos Set PhotoName=@PhotoName,Description=@Description Where ID=@ID";

            SqlParameter[] para =
            {
                new SqlParameter("@PhotoName",   model.PhotoName),
                new SqlParameter("@Description", model.Description),
                new SqlParameter("@ID",          model.Id)
            };

            int count = (int)DBHelper.ExecuteNonQuery(sql, para, CommandType.Text);

            if (count == 0)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 2
0
        public static Model.AlbumsPhotosModel GetPhotoMsg(string Id)
        {
            Model.AlbumsPhotosModel albModel = new Model.AlbumsPhotosModel();
            string sql = "Select * From AlbumsPhotos Where ID=@ID";

            SqlParameter[] para =
            {
                new SqlParameter("@ID", Id)
            };
            DataTable dt = DBHelper.ExecuteDataTable(sql, para, CommandType.Text);

            albModel.Id          = Convert.ToInt32(dt.Rows[0]["ID"].ToString());
            albModel.Number      = dt.Rows[0]["Number"].ToString();
            albModel.AlbumsID    = Convert.ToInt32(dt.Rows[0]["AlbumsID"].ToString());
            albModel.PhotoName   = dt.Rows[0]["PhotoName"].ToString();
            albModel.Description = dt.Rows[0]["Description"].ToString();
            albModel.PhotoPath   = dt.Rows[0]["PhotoPath"].ToString();
            albModel.Xuhao       = Convert.ToInt32(dt.Rows[0]["Xuhao"].ToString());
            albModel.UploadDate  = Convert.ToDateTime(dt.Rows[0]["UploadDate"].ToString());
            albModel.UploadIp    = dt.Rows[0]["UploadIp"].ToString();

            return(albModel);
        }
Esempio n. 3
0
        public static bool AddAlbumsPhotos(Model.AlbumsPhotosModel pModel)
        {
            string sql = @"Insert Into AlbumsPhotos(number,AlbumsID,PhotoName,Description,PhotoPath,Xuhao,UploadDate,UploadIP)
                            Values(@number,@AlbumsID,@PhotoName,@Description,@PhotoPath,@Xuhao,@UploadDate,@UploadIP)";

            SqlParameter[] para =
            {
                new SqlParameter("@number",      pModel.Number),
                new SqlParameter("@AlbumsID",    pModel.AlbumsID),
                new SqlParameter("@PhotoName",   pModel.PhotoName),
                new SqlParameter("@Description", pModel.Description),
                new SqlParameter("@PhotoPath",   pModel.PhotoPath),
                new SqlParameter("@Xuhao",       pModel.Xuhao),
                new SqlParameter("@UploadDate",  pModel.UploadDate),
                new SqlParameter("@UploadIP",    pModel.UploadIp)
            };
            int count = (int)DAL.DBHelper.ExecuteNonQuery(sql, para, CommandType.Text);

            if (count == 0)
            {
                return(false);
            }
            return(true);
        }
Esempio n. 4
0
 public static bool UpdatePhoto(Model.AlbumsPhotosModel model)
 {
     return(DAL.PersonalSpace.Message.UpdatePhoto(model));
 }
Esempio n. 5
0
 public static bool AddAlbumsPhotos(Model.AlbumsPhotosModel pModel)
 {
     return(DAL.PersonalSpace.Message.AddAlbumsPhotos(pModel));
 }