protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            CollectionFieldRuleInfo collectionFieldRuleInfo = new CollectionFieldRuleInfo();

            collectionFieldRuleInfo.ItemId    = BasePage.RequestInt32("ItemId");
            collectionFieldRuleInfo.FieldName = BasePage.RequestString("FieldName");
            collectionFieldRuleInfo.FieldType = BasePage.RequestString("FieldType");
            collectionFieldRuleInfo.RuleType  = 2;
            collectionFieldRuleInfo.BeginCode = this.TxtFieldBegin.Text;
            collectionFieldRuleInfo.EndCode   = this.TxtFieldEnd.Text;
            if (!this.RadlPaingType.Checked)
            {
                collectionFieldRuleInfo.UsePaging = true;
            }
            FieldType none = FieldType.None;

            if (Enum.IsDefined(typeof(FieldType), collectionFieldRuleInfo.FieldType))
            {
                none = (FieldType)Enum.Parse(typeof(FieldType), collectionFieldRuleInfo.FieldType);
            }
            if (((none != FieldType.BoolType) || (none != FieldType.NumberType)) || ((none != FieldType.MoneyType) || (none != FieldType.DateTimeType)))
            {
                StringBuilder builder = new StringBuilder();
                foreach (ListItem item in this.ListFilterRuleID.Items)
                {
                    if (item.Selected)
                    {
                        if (builder.Length > 0)
                        {
                            builder.Append("," + item.Value);
                        }
                        else
                        {
                            builder.Append(item.Value);
                        }
                    }
                }
                collectionFieldRuleInfo.FilterRuleId = builder.ToString();
                StringBuilder builder2 = new StringBuilder();
                foreach (ListItem item2 in this.ListFilterSelect.Items)
                {
                    if (item2.Selected)
                    {
                        if (builder2.Length > 0)
                        {
                            builder2.Append("," + item2.Value);
                        }
                        else
                        {
                            builder2.Append(item2.Value);
                        }
                    }
                }
                collectionFieldRuleInfo.PrivateFilter = builder2.ToString();
                switch (none)
                {
                case FieldType.FileType:
                {
                    FieldInfo fieldInfoByFieldName = Field.GetFieldInfoByFieldName(BasePage.RequestInt32("ModelId"), collectionFieldRuleInfo.FieldName);
                    collectionFieldRuleInfo.SpecialSetting = fieldInfoByFieldName.Settings[1].ToString() + "$$$" + fieldInfoByFieldName.Settings[3].ToString() + "$$$" + fieldInfoByFieldName.Settings[4].ToString();
                    goto Label_02BF;
                }

                case FieldType.KeywordType:
                    collectionFieldRuleInfo.SpecialSetting = this.TxtKeyWord.Text;
                    break;

                case FieldType.ContentType:
                    collectionFieldRuleInfo.SpecialSetting = this.SavePhoto.Checked.ToString();
                    goto Label_02BF;
                }
            }
            else
            {
                collectionFieldRuleInfo.FilterRuleId  = "";
                collectionFieldRuleInfo.PrivateFilter = "";
            }
Label_02BF:
            collectionFieldRuleInfo.ExclosionId = DataConverter.CLng(this.DropExclosionId.SelectedValue);
            if (CollectionFieldRules.Exists(this.m_ItemId, this.m_FieldName))
            {
                CollectionFieldRules.Update(collectionFieldRuleInfo);
            }
            else
            {
                CollectionFieldRules.Add(collectionFieldRuleInfo);
            }
            if (none == FieldType.ContentType)
            {
                this.SavePaing();
            }
            this.Page.ClientScript.RegisterClientScriptBlock(base.GetType(), "windowsclose", "<script type='text/javascript'>window.close();</script>");
        }
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         bool flag = false;
         this.Session["ShowCode"] = null;
         string fieldName = "";
         foreach (RepeaterItem item in this.RptModelList.Items)
         {
             RadioButton  button  = item.FindControl("RadDefault") as RadioButton;
             RadioButton  button2 = item.FindControl("RadDesignated") as RadioButton;
             RadioButton  button3 = item.FindControl("RadSet") as RadioButton;
             TextBox      box     = item.FindControl("TxtDesignated") as TextBox;
             Label        label   = item.FindControl("LblFieldName") as Label;
             HiddenField  field   = item.FindControl("HdnFieldName") as HiddenField;
             HiddenField  field2  = item.FindControl("HdnFieldType") as HiddenField;
             DropDownList list    = item.FindControl("DropStatusType") as DropDownList;
             bool         flag2   = false;
             if (((field.Value != "NodeId") && (field.Value != "InfoId")) && ((field.Value != "SpecialId") && (field.Value != "DefaultPicUrl")))
             {
                 CollectionFieldRuleInfo infoById = CollectionFieldRules.GetInfoById(this.m_itemId, field.Value);
                 if (!infoById.IsNull)
                 {
                     flag2 = true;
                 }
                 else
                 {
                     infoById = new CollectionFieldRuleInfo();
                 }
                 infoById.FieldName = field.Value;
                 infoById.FieldType = field2.Value;
                 infoById.RuleType  = 0;
                 infoById.ItemId    = this.m_itemId;
                 if ((!button.Checked && !button2.Checked) && !button3.Checked)
                 {
                     AdminPage.WriteErrMsg(label.Text + "没有选择规则类型!");
                 }
                 if (button.Checked)
                 {
                     FieldInfo fieldInfoByFieldName = Field.GetFieldInfoByFieldName(this.m_ModelId, infoById.FieldName);
                     if (fieldInfoByFieldName.IsNull)
                     {
                         AdminPage.WriteErrMsg("<li>没有" + infoById.FieldName + "字段,请检查模型!");
                     }
                     infoById.SpecialSetting = fieldInfoByFieldName.DefaultValue;
                 }
                 if (button2.Checked)
                 {
                     infoById.RuleType = 1;
                     if (field.Value == "Status")
                     {
                         infoById.SpecialSetting = list.SelectedValue;
                     }
                     else
                     {
                         infoById.SpecialSetting = box.Text;
                     }
                 }
                 if (button3.Checked)
                 {
                     infoById.RuleType = 2;
                     if (string.IsNullOrEmpty(infoById.BeginCode) || string.IsNullOrEmpty(infoById.EndCode))
                     {
                         AdminPage.WriteErrMsg(label.Text + "使用采集规则,但规则为空请返回重新设置该字段采集规则!");
                     }
                 }
                 if (string.IsNullOrEmpty(fieldName))
                 {
                     fieldName = infoById.FieldName;
                 }
                 else
                 {
                     fieldName = fieldName + "," + infoById.FieldName;
                 }
                 if (flag2)
                 {
                     flag = CollectionFieldRules.Update(infoById);
                 }
                 else
                 {
                     flag = CollectionFieldRules.Add(infoById);
                 }
                 if (!flag)
                 {
                     AdminPage.WriteErrMsg(label.Text + "保存失败!");
                 }
             }
         }
         if (!string.IsNullOrEmpty(fieldName))
         {
             IList <CollectionFieldRuleInfo> list2 = CollectionFieldRules.GetList(this.m_ModelId);
             string str2 = "";
             foreach (CollectionFieldRuleInfo info3 in list2)
             {
                 if (string.IsNullOrEmpty(str2))
                 {
                     str2 = info3.FieldName;
                 }
                 else
                 {
                     str2 = str2 + "," + info3.FieldName;
                 }
             }
             foreach (string str3 in str2.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries))
             {
                 if (!StringHelper.FoundCharInArr(fieldName, str3))
                 {
                     CollectionFieldRules.DeleteFieldName(this.m_itemId, str3);
                 }
             }
         }
         if (flag)
         {
             AdminPage.WriteSuccessMsg(this.LblItemName.Text + "采集项目创建完毕!", "ItemManage.aspx");
         }
     }
 }