示例#1
0
 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();
     }
 }
示例#2
0
 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) + "'");
     }
 }