예제 #1
0
파일: Superior.cs 프로젝트: suizhikuo/KYCMS
 public void Add(M_Superior model)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@Name", SqlDbType.NVarChar), new SqlParameter("@StartCode", SqlDbType.NVarChar), new SqlParameter("@EndCode", SqlDbType.NVarChar) };
     commandParameters[0].Value = model.Name;
     commandParameters[1].Value = model.StartCode;
     commandParameters[2].Value = model.EndCode;
     SqlHelper.ExecuteNonQuery(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Superior_Add", commandParameters);
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     AdminGroupBll.Power_Judge(48);
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null && Request.QueryString["id"].Length != 0)
         {
             int id = int.Parse(Request.QueryString["id"]);
             SuperiorM = SuperiorBll.GetIdBySuperior(id);
             txtSuperiorName.Text = SuperiorM.Name;
             txtStartCode.Text = SuperiorM.StartCode;
             txtEndCode.Text = SuperiorM.EndCode;
             btnAdd.Text = "修改";
         }
     }
 }
예제 #3
0
파일: Superior.cs 프로젝트: suizhikuo/KYCMS
 public M_Superior GetIdBySuperior(int id)
 {
     SqlParameter[] commandParameters = new SqlParameter[] { new SqlParameter("@id", SqlDbType.Int, 4) };
     commandParameters[0].Value = id;
     M_Superior superior = new M_Superior();
     DataTable table = SqlHelper.ExecuteTable(SqlHelper.ConnectionStringKy, CommandType.StoredProcedure, "Up_Superior_GetIdBySuperiorl", commandParameters);
     superior.id = id;
     if (table.Rows.Count > 0)
     {
         superior.Name = table.Rows[0]["Name"].ToString();
         superior.StartCode = table.Rows[0]["StartCode"].ToString();
         superior.EndCode = table.Rows[0]["EndCode"].ToString();
         return superior;
     }
     return null;
 }
예제 #4
0
 public void Update(M_Superior model)
 {
     this.dal.Update(model);
 }
예제 #5
0
 public void Add(M_Superior model)
 {
     this.dal.Add(model);
 }
예제 #6
0
        private string GetContent(M_Collection collectionM, string contentStr)
        {
            this.ColumnM = this.ColumnBll.GetColumn(collectionM.ColId);
            this.ChannelM = this.ChannelBll.GetChannel(this.ColumnM.ChId);
            this.ModelM = this.InfoModelBll.GetModel(this.ChannelM.ModelType);
            this.SiteModel = this.SiteBll.GetSiteModel();
            B_ConvertImage image = new B_ConvertImage(this.SiteModel.Domain, this.ModelM.UploadPath);
            string simpleFilterRule = collectionM.SimpleFilterRule;
            string pattern = string.Empty;
            string complexityFilterRule = collectionM.ComplexityFilterRule;
            if (complexityFilterRule != "")
            {
                string[] strArray = complexityFilterRule.Split(new char[] { ',' });
                for (int i = 0; i < strArray.Length; i++)
                {
                    this.SuperiorM = this.SuperiorBll.GetIdBySuperior(int.Parse(strArray[i].ToString()));
                    pattern = this.TransferStr(this.SuperiorM.StartCode) + "((?:.|\n)*?)" + this.TransferStr(this.SuperiorM.EndCode);
                    contentStr = this.SuperiorHtml(contentStr, pattern);
                }
            }
            if (simpleFilterRule != "")
            {
                string[] strArray2 = simpleFilterRule.Split(new char[] { ',' });
                for (int j = 0; j < (strArray2.Length - 1); j++)
                {
                    switch (int.Parse(strArray2[j].ToString()))
                    {
                        case 0:
                            contentStr = this.FilterObject(contentStr);
                            break;

                        case 1:
                            contentStr = this.FilterScript(contentStr);
                            break;

                        case 2:
                            contentStr = this.FilterStyle(contentStr);
                            break;

                        case 3:
                            contentStr = this.FilterDiv(contentStr);
                            break;

                        case 4:
                            contentStr = this.FilterSpan(contentStr);
                            break;

                        case 5:
                            contentStr = this.FilterTableProtery(contentStr);
                            break;

                        case 6:
                            contentStr = this.FilterImg(contentStr);
                            break;

                        case 7:
                            contentStr = this.FilterFont(contentStr);
                            break;

                        case 8:
                            contentStr = this.FilterA(contentStr);
                            break;

                        case 9:
                            contentStr = this.RemoveHtml(contentStr);
                            break;
                    }
                }
            }
            contentStr = image.ConvertLocalImagePath(contentStr);
            contentStr = image.ConvertContent(contentStr);
            return contentStr;
        }