Exemplo n.º 1
0
        /// <summary>
        /// 修改通知信息
        /// </summary>
        /// <param name="u"></param>
        /// <returns></returns>
        /*
         * UPDATE [dbo].[AccountManage] SET [am_LoginUser] =''  ,[am_PWD] =,
                 [am_Email] = '',
                 [am_Name] ='',
                 [am_Phone] = '',
                 [am_Status] = '',
                 [am_CreateTime] = ''
                    WHERE  [am_ID]=@am_ID
         */
        public static JsMessage Modify_Notice(NoticeInfo no)
        {
            JsMessage js = new JsMessage();
            string SqlStr = "UPDATE [dbo].[Notice] SET [no_Title] =@no_Title,[no_Content] =@no_Content  WHERE  [no_ID]=@no_ID";

            SqlParameter[] commandParameters = new SqlParameter[]{
                new SqlParameter("@no_Title",no.No_Title),
                new SqlParameter("@no_Content",no.No_Content),
                new SqlParameter("@no_ID",no.No_ID)
            };
            try
            {
                int flg = SqlHelper.ExecteNonQueryText(SqlStr, commandParameters);
                if (flg == 1)
                {
                    js.IsSuccess = true;
                }
                else
                {
                    js.IsSuccess = false;
                }
            }
            catch (SqlException ex)
            {
                js.IsSuccess = false;
                js.ErrorMsg = ex.ToString();
            }
            return js;
        }
Exemplo n.º 2
0
 public static JsMessage Add_Notice(NoticeInfo no)
 {
     JsMessage js = new JsMessage();
     string SqlStr = "INSERT INTO [dbo].[Notice] ([no_Title],[no_Content],[no_PublicTime],[no_IsExpired]) values (@no_Title,@no_Content,@no_PublicTime,@no_IsExpired)";
     SqlParameter[] commandParameters = new SqlParameter[]{
         new SqlParameter("@no_Title",no.No_Title),
         new SqlParameter("@no_Content",no.No_Content),
         new SqlParameter("@no_PublicTime",no.No_PublicTime),
         new SqlParameter("@no_IsExpired",no.No_IsExpired)
     };
     try
     {
         int flg = SqlHelper.ExecteNonQueryText(SqlStr, commandParameters);
         if (flg == 1)
         {
             js.IsSuccess = true;
         }
         else
         {
             js.IsSuccess = false;
         }
     }
     catch (SqlException ex)
     {
         js.IsSuccess = false;
         js.ErrorMsg = ex.ToString();
     }
     return js;
 }