示例#1
0
 public void btnSave_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrWhiteSpace(this.txtClassName.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorClassNameNull);
     }
     else if (!PageValidate.IsNumber(this.txtSequence.Text))
     {
         MessageBox.ShowFailTip(this, CMSPhoto.ErrorOrderFormat);
     }
     else
     {
         int num2;
         Maticsoft.BLL.CMS.PhotoClass class2 = new Maticsoft.BLL.CMS.PhotoClass();
         string text = this.txtClassName.Text;
         int classID = 0;
         if (!string.IsNullOrWhiteSpace(this.ddlPhotoClass.SelectedValue))
         {
             classID = int.Parse(this.ddlPhotoClass.SelectedValue);
         }
         Maticsoft.Model.CMS.PhotoClass model = class2.GetModel(classID);
         string str2 = string.Empty;
         if (model != null)
         {
             str2 = model.Path + classID + "|";
             num2 = model.Depth.Value + 1;
         }
         else
         {
             str2 = "0|";
             num2 = 1;
         }
         int num3 = int.Parse(this.txtSequence.Text);
         Maticsoft.Model.CMS.PhotoClass class4 = class2.GetModel(this.ClassID);
         class4.ClassName = text;
         class4.Path = str2;
         class4.Depth = new int?(num2);
         class4.ParentId = new int?(classID);
         class4.Sequence = new int?(num3);
         if (class2.Update(class4))
         {
             MessageBox.ResponseScript(this, "parent.location.href='List.aspx'");
         }
         else
         {
             MessageBox.ShowFailTip(this, Site.TooltipSaveError);
         }
     }
 }
示例#2
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;
 }