protected void SubmitButton_Click(object sender, EventArgs e) { FlashPhotoInfo flashPhoto = new FlashPhotoInfo(); flashPhoto.ID = RequestHelper.GetQueryString <int>("ID"); flashPhoto.FlashID = RequestHelper.GetQueryString <int>("FlashID"); flashPhoto.Title = this.Title.Text; flashPhoto.URL = this.URL.Text; flashPhoto.FileName = this.FileName.Text; flashPhoto.Date = RequestHelper.DateNow; string message = ShopLanguage.ReadLanguage("AddOK"); if (flashPhoto.ID == -2147483648) { base.CheckAdminPower("AddFlashPhoto", PowerCheckType.Single); int id = FlashPhotoBLL.AddFlashPhoto(flashPhoto); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("AddRecord"), ShopLanguage.ReadLanguage("FlashPhoto"), id); } else { base.CheckAdminPower("UpdateFlashPhoto", PowerCheckType.Single); FlashPhotoBLL.UpdateFlashPhoto(flashPhoto); AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("UpdateRecord"), ShopLanguage.ReadLanguage("FlashPhoto"), flashPhoto.ID); message = ShopLanguage.ReadLanguage("UpdateOK"); } ScriptHelper.Alert(message, RequestHelper.RawUrl); }
public static int AddFlashPhoto(FlashPhotoInfo flashPhoto) { flashPhoto.ID = dal.AddFlashPhoto(flashPhoto); UploadBLL.UpdateUpload(TableID, flashPhoto.FlashID, flashPhoto.ID, Cookies.Admin.GetRandomNumber(false)); FlashBLL.ChangeFlashCount(flashPhoto.FlashID, ChangeAction.Plus); FlashBLL.RebuildFile(flashPhoto.FlashID); return(flashPhoto.ID); }
public void UpdateFlashPhoto(FlashPhotoInfo flashPhoto) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int), new SqlParameter("@flashID", SqlDbType.Int), new SqlParameter("@title", SqlDbType.NVarChar), new SqlParameter("@fileName", SqlDbType.NVarChar), new SqlParameter("@uRL", SqlDbType.NVarChar) }; pt[0].Value = flashPhoto.ID; pt[1].Value = flashPhoto.FlashID; pt[2].Value = flashPhoto.Title; pt[3].Value = flashPhoto.FileName; pt[4].Value = flashPhoto.URL; ShopMssqlHelper.ExecuteNonQuery(ShopMssqlHelper.TablePrefix + "UpdateFlashPhoto", pt); }
public int AddFlashPhoto(FlashPhotoInfo flashPhoto) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@flashID", SqlDbType.Int), new SqlParameter("@title", SqlDbType.NVarChar), new SqlParameter("@fileName", SqlDbType.NVarChar), new SqlParameter("@uRL", SqlDbType.NVarChar), new SqlParameter("@orderID", SqlDbType.Int), new SqlParameter("@date", SqlDbType.DateTime) }; pt[0].Value = flashPhoto.FlashID; pt[1].Value = flashPhoto.Title; pt[2].Value = flashPhoto.FileName; pt[3].Value = flashPhoto.URL; pt[4].Value = flashPhoto.OrderID; pt[5].Value = flashPhoto.Date; return(Convert.ToInt32(ShopMssqlHelper.ExecuteScalar(ShopMssqlHelper.TablePrefix + "AddFlashPhoto", pt))); }
public void PrepareFlashPhotoModel(SqlDataReader dr, List <FlashPhotoInfo> flashPhotoList) { while (dr.Read()) { FlashPhotoInfo item = new FlashPhotoInfo(); item.ID = dr.GetInt32(0); item.FlashID = dr.GetInt32(1); item.Title = dr[2].ToString(); item.FileName = dr[3].ToString(); item.URL = dr[4].ToString(); item.OrderID = dr.GetInt32(5); item.Date = dr.GetDateTime(6); flashPhotoList.Add(item); } }
public FlashPhotoInfo ReadFlashPhoto(int id) { SqlParameter[] pt = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int) }; pt[0].Value = id; FlashPhotoInfo info = new FlashPhotoInfo(); using (SqlDataReader reader = ShopMssqlHelper.ExecuteReader(ShopMssqlHelper.TablePrefix + "ReadFlashPhoto", pt)) { if (reader.Read()) { info.ID = reader.GetInt32(0); info.FlashID = reader.GetInt32(1); info.Title = reader[2].ToString(); info.FileName = reader[3].ToString(); info.URL = reader[4].ToString(); info.OrderID = reader.GetInt32(5); info.Date = reader.GetDateTime(6); } } return(info); }
protected void Page_Load(object sender, EventArgs e) { if (!this.Page.IsPostBack) { base.CheckAdminPower("ReadFlashPhoto", PowerCheckType.Single); this.flashID = RequestHelper.GetQueryString <int>("FlashID"); string queryString = RequestHelper.GetQueryString <string>("Action"); int id = RequestHelper.GetQueryString <int>("PhotoID"); if ((queryString != string.Empty) && (id != -2147483648)) { base.CheckAdminPower("UpdateFlashPhoto", PowerCheckType.Single); string str2 = queryString; if (str2 != null) { if (!(str2 == "Up")) { if (str2 == "Down") { FlashPhotoBLL.ChangeFlashPhotoOrder(ChangeAction.Down, id, this.flashID); } } else { FlashPhotoBLL.ChangeFlashPhotoOrder(ChangeAction.Up, id, this.flashID); } } AdminLogBLL.AddAdminLog(ShopLanguage.ReadLanguage("MoveRecord"), ShopLanguage.ReadLanguage("FlashPhoto"), id); } int num2 = RequestHelper.GetQueryString <int>("ID"); if (num2 != -2147483648) { FlashPhotoInfo info = FlashPhotoBLL.ReadFlashPhoto(num2); this.Title.Text = info.Title; this.URL.Text = info.URL; this.FileName.Text = info.FileName; } base.BindControl(FlashPhotoBLL.ReadFlashPhotoByFlash(this.flashID), this.RecordList); } }
public static void UpdateFlashPhoto(FlashPhotoInfo flashPhoto) { dal.UpdateFlashPhoto(flashPhoto); UploadBLL.UpdateUpload(TableID, flashPhoto.FlashID, flashPhoto.ID, Cookies.Admin.GetRandomNumber(false)); FlashBLL.RebuildFile(flashPhoto.FlashID); }