示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!base.IsPostBack)
     {
         Maticsoft.BLL.CMS.PhotoClass class2 = new Maticsoft.BLL.CMS.PhotoClass();
         this.txtSequence.Text = class2.GetMaxSequence().ToString();
     }
 }
示例#2
0
 protected void btnSave_Click(object sender, EventArgs e)
 {
     Maticsoft.BLL.CMS.PhotoClass class2 = new Maticsoft.BLL.CMS.PhotoClass();
     if (string.IsNullOrWhiteSpace(this.txtClassName.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorClassNameNull);
     }
     else if (string.IsNullOrWhiteSpace(this.txtClassName.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorClassNameNull);
     }
     else if (class2.ExistsByClassName(this.txtClassName.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorClassRepeat);
     }
     else if (!PageValidate.IsNumber(this.txtSequence.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorOrderFormat);
     }
     else
     {
         int num3;
         string text = this.txtClassName.Text;
         int classID = 0;
         if (!string.IsNullOrWhiteSpace(this.ddlPhotoClass.SelectedValue))
         {
             classID = int.Parse(this.ddlPhotoClass.SelectedValue);
         }
         int num2 = int.Parse(this.txtSequence.Text);
         Maticsoft.Model.CMS.PhotoClass model = class2.GetModel(classID);
         string str2 = string.Empty;
         if (model != null)
         {
             str2 = model.Path + classID + "|";
             num3 = model.Depth.Value + 1;
         }
         else
         {
             str2 = "0|";
             num3 = 1;
         }
         Maticsoft.Model.CMS.PhotoClass class6 = new Maticsoft.Model.CMS.PhotoClass {
             ClassName = text,
             ParentId = new int?(classID),
             Sequence = new int?(num2),
             Path = str2,
             Depth = new int?(num3)
         };
         Maticsoft.Model.CMS.PhotoClass class4 = class6;
         new Maticsoft.BLL.CMS.PhotoClass().Add(class4);
         MessageBox.ResponseScript(this, "parent.location.href='List.aspx'");
     }
 }
 public override void DataBind()
 {
     this.Items.Clear();
     if (this.NullToDisplay)
     {
         this.Items.Add(new ListItem("", "0"));
     }
     DataSet list = new PhotoClass().GetList(this.ParentId.HasValue ? ("ParentId=" + this.ParentId) : "0");
     if ((list != null) && (list.Tables[0].Rows.Count > 0))
     {
         TreeBind.SetMultiLevelDropDownList(this, "ParentId", list.Tables[0]);
     }
     base.DataBind();
 }
示例#4
0
 public string GetParentName(object obj)
 {
     string s = string.Empty;
     Maticsoft.BLL.CMS.PhotoClass class2 = new Maticsoft.BLL.CMS.PhotoClass();
     if (((obj != null) && (obj.ToString() != "0")) && PageValidate.IsNumber(obj.ToString()))
     {
         s = obj.ToString();
         Maticsoft.Model.CMS.PhotoClass model = class2.GetModel(int.Parse(s));
         if (model != null)
         {
             s = model.ClassName;
         }
     }
     return s;
 }
示例#5
0
 private void ShowInfo(int ClassID)
 {
     Maticsoft.Model.CMS.PhotoClass model = new Maticsoft.BLL.CMS.PhotoClass().GetModel(ClassID);
     this.txtClassName.Text = model.ClassName;
     this.txtSequence.Text = model.Sequence.ToString();
     this.ddlPhotoClass.SelectedValue = model.ParentId.ToString();
 }