コード例 #1
0
ファイル: WebSetInfo.cs プロジェクト: yangningyuan/yny_003
 private static Model.WebSetInfo TranEntity(DataRow dr)
 {
     Model.WebSetInfo model = new Model.WebSetInfo();
     if (!string.IsNullOrEmpty(dr["WebState"].ToString()))
     {
         model.WebState = bool.Parse(dr["WebState"].ToString());
     }
     if (!string.IsNullOrEmpty(dr["WebTitle"].ToString()))
     {
         model.WebTitle = dr["WebTitle"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["WKeyword"].ToString()))
     {
         model.WKeyword = dr["WKeyword"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["WDescription"].ToString()))
     {
         model.WDescription = dr["WDescription"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["OpenTimeStr"].ToString()))
     {
         model.OpenTimeStr = dr["OpenTimeStr"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["CloseInfo"].ToString()))
     {
         model.CloseInfo = dr["CloseInfo"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["TXInfo"].ToString()))
     {
         model.TXInfo = dr["TXInfo"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["HKInfo"].ToString()))
     {
         model.HKInfo = dr["HKInfo"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["WCopyright"].ToString()))
     {
         model.WCopyright = dr["WCopyright"].ToString();
     }
     if (!string.IsNullOrEmpty(dr["PageSize"].ToString()))
     {
         model.PageSize = int.Parse(dr["PageSize"].ToString());
     }
     return(model);
 }
コード例 #2
0
ファイル: WebSetInfo.cs プロジェクト: yangningyuan/yny_003
        public static bool Update(Model.WebSetInfo model)
        {
            StringBuilder sb = new StringBuilder("update WebSetInfo set ");

            sb.Append("WebState=@WebState,");
            sb.Append("WebTitle=@WebTitle,");
            sb.Append("WKeyword=@WKeyword,");
            sb.Append("WDescription=@WDescription,");
            sb.Append("OpenTimeStr=@OpenTimeStr,");
            sb.Append("CloseInfo=@CloseInfo,");
            sb.Append("TXInfo=@TXInfo,");
            sb.Append("WCopyright=@WCopyright,");
            sb.Append("HKInfo=@HKInfo,");
            sb.Append("PageSize=@PageSize");

            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@WebState", SqlDbType.Bit, 1),
                new SqlParameter("@WebTitle", SqlDbType.NVarChar, 255),
                new SqlParameter("@WKeyword", SqlDbType.NVarChar, 255),
                new SqlParameter("@WDescription", SqlDbType.NVarChar, 255),
                new SqlParameter("@OpenTimeStr", SqlDbType.VarChar, 100),
                new SqlParameter("@CloseInfo", SqlDbType.NVarChar, 255),
                new SqlParameter("@TXInfo", SqlDbType.NVarChar, 255),
                new SqlParameter("@HKInfo", SqlDbType.NVarChar, 255),
                new SqlParameter("@WCopyright", SqlDbType.NVarChar, 255),
                new SqlParameter("@PageSize", SqlDbType.Int, 4)
            };
            para[0].Value = model.WebState;
            para[1].Value = model.WebTitle;
            para[2].Value = model.WKeyword;
            para[3].Value = model.WDescription;
            para[4].Value = model.OpenTimeStr;
            para[5].Value = model.CloseInfo;
            para[6].Value = model.TXInfo;
            para[7].Value = model.HKInfo;
            para[8].Value = model.WCopyright;
            para[9].Value = model.PageSize;
            Model         = null;
            return(DbHelperSQL.ExecuteSql(sb.ToString(), para) > 0);
        }
コード例 #3
0
        private static Model.WebSetInfo TranEntity(DataRow dr)
        {
            if (dr != null)
            {
                Model.WebSetInfo model = new Model.WebSetInfo();

                if (!string.IsNullOrEmpty(dr["WebState"].ToString()))
                {
                    model.WebState = bool.Parse(dr["WebState"].ToString());
                }
                if (!string.IsNullOrEmpty(dr["PageSize"].ToString()))
                {
                    model.PageSize = int.Parse(dr["PageSize"].ToString());
                }
                model.RegionalDirectorCondition = dr["RegionalDirectorCondition"].ToString();
                model.RegionalDirectorTreatment = dr["RegionalDirectorTreatment"].ToString();
                model.ServerCenterCondition     = dr["ServerCenterCondition"].ToString();
                model.ServerCenterTreatment     = dr["ServerCenterTreatment"].ToString();
                model.BTCenterCondition         = dr["BTCenterCondition"].ToString();
                model.BTCenterTreatment         = dr["BTCenterTreatment"].ToString();
                model.WebTitle     = dr["WebTitle"].ToString();
                model.WKeyword     = dr["WKeyword"].ToString();
                model.WDescription = dr["WDescription"].ToString();
                model.WCopyright   = dr["WCopyright"].ToString();
                model.OpenTimeStr  = dr["OpenTimeStr"].ToString();
                model.CloseInfo    = dr["CloseInfo"].ToString();
                model.TXInfo       = dr["TXInfo"].ToString();
                model.HKInfo       = dr["HKInfo"].ToString();

                return(model);
            }
            else
            {
                return(null);
            }
        }
コード例 #4
0
 public static bool Update(Model.WebSetInfo model)
 {
     return(DAL.WebSetInfo.Update(model));
 }
コード例 #5
0
ファイル: WebSet.aspx.cs プロジェクト: yangningyuan/yny_005
 protected override void SetValue()
 {
     SetInfo = BLL.WebSetInfo.Model;
 }
コード例 #6
0
        public static bool Update(Model.WebSetInfo model)
        {
            string        guid   = Guid.NewGuid().ToString();
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update WebSetInfo set ");

            strSql.Append(" WebState = @WebState , ");
            strSql.Append(" PageSize = @PageSize , ");
            strSql.Append(" RegionalDirectorCondition = @RegionalDirectorCondition , ");
            strSql.Append(" RegionalDirectorTreatment = @RegionalDirectorTreatment , ");
            strSql.Append(" ServerCenterCondition = @ServerCenterCondition , ");
            strSql.Append(" ServerCenterTreatment = @ServerCenterTreatment , ");
            strSql.Append(" BTCenterCondition = @BTCenterCondition , ");
            strSql.Append(" BTCenterTreatment = @BTCenterTreatment , ");
            strSql.Append(" WebTitle = @WebTitle , ");
            strSql.Append(" WKeyword = @WKeyword , ");
            strSql.Append(" WDescription = @WDescription , ");
            strSql.Append(" WCopyright = @WCopyright , ");
            strSql.Append(" OpenTimeStr = @OpenTimeStr , ");
            strSql.Append(" CloseInfo = @CloseInfo , ");
            strSql.Append(" TXInfo = @TXInfo , ");
            strSql.Append(" HKInfo = @HKInfo  ");
            //strSql.Append(" where WebState=@WebState and WebTitle=@WebTitle and WKeyword=@WKeyword and WDescription=@WDescription and WCopyright=@WCopyright and OpenTimeStr=@OpenTimeStr and CloseInfo=@CloseInfo and TXInfo=@TXInfo and HKInfo=@HKInfo and PageSize=@PageSize and RegionalDirectorCondition=@RegionalDirectorCondition and RegionalDirectorTreatment=@RegionalDirectorTreatment and ServerCenterCondition=@ServerCenterCondition and ServerCenterTreatment=@ServerCenterTreatment and BTCenterCondition=@BTCenterCondition and BTCenterTreatment=@BTCenterTreatment  ");
            strSql.AppendFormat(" ;select '{0}'", guid);

            SqlParameter[] parameters =
            {
                new SqlParameter("@WebState",                  SqlDbType.Bit,        1),
                new SqlParameter("@PageSize",                  SqlDbType.Int,        4),
                new SqlParameter("@RegionalDirectorCondition", SqlDbType.NVarChar, 500),
                new SqlParameter("@RegionalDirectorTreatment", SqlDbType.NVarChar, 500),
                new SqlParameter("@ServerCenterCondition",     SqlDbType.NVarChar, 500),
                new SqlParameter("@ServerCenterTreatment",     SqlDbType.NVarChar, 500),
                new SqlParameter("@BTCenterCondition",         SqlDbType.NVarChar, 500),
                new SqlParameter("@BTCenterTreatment",         SqlDbType.NVarChar, 500),
                new SqlParameter("@WebTitle",                  SqlDbType.NVarChar, 255),
                new SqlParameter("@WKeyword",                  SqlDbType.NVarChar, 255),
                new SqlParameter("@WDescription",              SqlDbType.NVarChar, 255),
                new SqlParameter("@WCopyright",                SqlDbType.NVarChar, 255),
                new SqlParameter("@OpenTimeStr",               SqlDbType.VarChar,  100),
                new SqlParameter("@CloseInfo",                 SqlDbType.NVarChar, 255),
                new SqlParameter("@TXInfo",                    SqlDbType.NVarChar, 255),
                new SqlParameter("@HKInfo",                    SqlDbType.NVarChar, 2550)
            };

            parameters[0].Value  = model.WebState;
            parameters[1].Value  = model.PageSize;
            parameters[2].Value  = model.RegionalDirectorCondition;
            parameters[3].Value  = model.RegionalDirectorTreatment;
            parameters[4].Value  = model.ServerCenterCondition;
            parameters[5].Value  = model.ServerCenterTreatment;
            parameters[6].Value  = model.BTCenterCondition;
            parameters[7].Value  = model.BTCenterTreatment;
            parameters[8].Value  = model.WebTitle;
            parameters[9].Value  = model.WKeyword;
            parameters[10].Value = model.WDescription;
            parameters[11].Value = model.WCopyright;
            parameters[12].Value = model.OpenTimeStr;
            parameters[13].Value = model.CloseInfo;
            parameters[14].Value = model.TXInfo;
            parameters[15].Value = model.HKInfo;
            Model = null;
            return(DbHelperSQL.ExecuteSql(strSql.ToString(), parameters) > 0);
        }