コード例 #1
0
ファイル: Modify.cs プロジェクト: huaminglee/myyyyshop
 public void btnSave_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.txtAlbumName.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorAlbumNull);
     }
     else if (!PageValidate.IsNumber(this.txtSequence.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorOrderFormat);
     }
     else
     {
         string text = this.txtAlbumName.Text;
         string str2 = this.txtDescription.Text;
         int num = int.Parse(this.radlState.SelectedValue);
         int num2 = int.Parse(this.txtSequence.Text);
         Maticsoft.BLL.CMS.PhotoAlbum album = new Maticsoft.BLL.CMS.PhotoAlbum();
         Maticsoft.Model.CMS.PhotoAlbum model = album.GetModel(this.AlbumID);
         model.AlbumName = text;
         model.Description = str2;
         model.State = num;
         model.Sequence = num2;
         model.Privacy = int.Parse(this.radlPrivacy.SelectedValue);
         model.LastUpdatedDate = DateTime.Now;
         if (album.Update(model))
         {
             MessageBox.ResponseScript(this, "parent.location.href='List.aspx'");
         }
         else
         {
             MessageBox.ShowFailTip(this, Site.TooltipUpdateError);
         }
     }
 }
コード例 #2
0
ファイル: List.cs プロジェクト: huaminglee/myyyyshop
 private void BindData(string strWhere)
 {
     if (!string.IsNullOrWhiteSpace(strWhere))
     {
         strWhere = "AlbumName LIKE '%" + strWhere + "%'";
     }
     PhotoAlbum album = new PhotoAlbum();
     this.AspNetPager1.RecordCount = album.GetRecordCount(strWhere);
     this.RepeaterPhotoAlbum.DataSource = album.GetListByPage(strWhere, "", this.AspNetPager1.StartRecordIndex, this.AspNetPager1.EndRecordIndex);
     this.RepeaterPhotoAlbum.DataBind();
 }
コード例 #3
0
ファイル: Add.cs プロジェクト: huaminglee/myyyyshop
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.UserPrincipal.HasPermissionID(base.GetPermidByActID(base.Act_AddData)))
     {
         MessageBox.ShowAndBack(this, "您没有权限");
     }
     else
     {
         Maticsoft.BLL.CMS.PhotoAlbum album = new Maticsoft.BLL.CMS.PhotoAlbum();
         this.txtSequence.Text = album.GetMaxSequence().ToString();
     }
 }
コード例 #4
0
ファイル: Modify.cs プロジェクト: huaminglee/myyyyshop
 private void ShowInfo(int AlbumID)
 {
     Maticsoft.Model.CMS.PhotoAlbum model = new Maticsoft.BLL.CMS.PhotoAlbum().GetModel(AlbumID);
     this.txtAlbumName.Text = model.AlbumName;
     this.txtDescription.Text = model.Description;
     Maticsoft.Model.CMS.Photo photo2 = new Maticsoft.BLL.CMS.Photo().GetModel(model.CoverPhoto.Value);
     if (photo2 != null)
     {
         this.imgCoverPhoto.ImageUrl = FileHelper.GeThumbImage(photo2.ThumbImageUrl, "T235x1280_");
     }
     this.radlState.SelectedValue = model.State.ToString();
     this.lblCreatedUserID.Text = model.CreatedUserID.ToString();
     this.lblCreatedDate.Text = model.CreatedDate.ToString();
     this.lblPVCount.Text = model.PVCount.ToString();
     this.txtSequence.Text = model.Sequence.ToString();
     this.radlPrivacy.SelectedValue = model.Privacy.ToString();
     this.lblLastUpdatedDate.Text = model.LastUpdatedDate.ToString();
 }
コード例 #5
0
ファイル: Add.cs プロジェクト: huaminglee/myyyyshop
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Maticsoft.BLL.CMS.PhotoAlbum album = new Maticsoft.BLL.CMS.PhotoAlbum();
     if (string.IsNullOrWhiteSpace(this.txtAlbumName.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorAlbumNull);
     }
     else if (string.IsNullOrWhiteSpace(this.txtDescription.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorIntroductionNull);
     }
     else if (!PageValidate.IsNumber(this.txtSequence.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorOrderFormat);
     }
     else
     {
         string text = this.txtAlbumName.Text;
         string str2 = this.txtDescription.Text;
         int num = int.Parse(this.radlState.SelectedValue);
         int num2 = 0;
         int num3 = int.Parse(this.radlPrivacy.SelectedValue);
         Maticsoft.Model.CMS.PhotoAlbum album3 = new Maticsoft.Model.CMS.PhotoAlbum {
             AlbumName = text,
             Description = str2,
             CoverPhoto = 0,
             State = num,
             CreatedUserID = base.CurrentUser.UserID,
             CreatedDate = DateTime.Now,
             PVCount = num2,
             Sequence = album.GetMaxSequence(),
             Privacy = num3,
             LastUpdatedDate = DateTime.Now
         };
         Maticsoft.Model.CMS.PhotoAlbum model = album3;
         MessageBox.ResponseScript(this, "parent.location.href='/Admin/CMS/Photo/add.aspx?AlbumID=" + album.Add(model) + "'");
     }
 }
コード例 #6
0
ファイル: List.cs プロジェクト: huaminglee/myyyyshop
 protected void RepeaterPhotoAlbum_ItemCommand(object source, DataListCommandEventArgs e)
 {
     if (e.CommandName == "delete")
     {
         PhotoAlbum album = new PhotoAlbum();
         if (e.CommandArgument != null)
         {
             int albumID = Globals.SafeInt(e.CommandArgument.ToString(), 0);
             if (!album.Delete(albumID))
             {
                 MessageBox.ShowFailTip(this, Site.TooltipDelError);
                 return;
             }
             new Photo().UpdatePhotoAlbum(albumID, 0);
             MessageBox.ShowSuccessTip(this, Site.TooltipDelOK);
         }
         this.BindData(this.txtKeyword.Text.Trim());
     }
 }