Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     helpinfo = Helps.getmessage(id);
     if (Helps.choosepage(helpinfo.Pid) == true)
     {
         Response.Redirect("global_edithelpclass.aspx?id="+id);
         return;
     }
     if (!Page.IsPostBack)
     {
         if ((this.username != null) && (this.username != ""))
         {
             if (id == 0)
             {
                 return;
             }
             else
             {
                 poster.Text = this.username;
                 type.AddTableData(Helps.bindhelptype());
                 type.SelectedValue = helpinfo.Pid.ToString();
                 orderby.Text = helpinfo.Orderby.ToString();
                 tbtitle.Text = helpinfo.Title;
                 message.Text = helpinfo.Message;
                 updatehelp.ValidateForm = true;
                 tbtitle.AddAttributes("maxlength", "200");
                 tbtitle.AddAttributes("rows", "2");
                 type.DataBind();
             }
         }
     }
 }
Пример #2
0
        /// <summary>
        /// 获取帮助列表
        /// </summary>
        /// <returns>帮助列表</returns>
        public static ArrayList GetHelpList()
        {
            IDataReader readclass = DatabaseProvider.GetInstance().GetHelpClass();
            ArrayList helplist = new ArrayList();

            if (readclass != null)
            {
                while (readclass.Read())
                {

                    IDataReader reader = DatabaseProvider.GetInstance().GetHelpList(int.Parse(readclass["id"].ToString()));

                    if (reader != null)
                    {
                        while (reader.Read())
                        {
                            HelpInfo info = new HelpInfo();
                            info.Id = int.Parse(reader["id"].ToString());
                            info.Title = reader["title"].ToString();
                            info.Message = reader["message"].ToString();
                            info.Pid = int.Parse(reader["pid"].ToString());
                            info.Orderby = int.Parse(reader["orderby"].ToString());
                            helplist.Add(info);
                        }
                        reader.Close();
                    }
                }
                readclass.Close();
            }
            return helplist;
        }
Пример #3
0
 /// <summary>
 /// 获取帮助内容
 /// </summary>
 /// <param name="id"></param>
 /// <returns>帮助内容</returns>
 public static HelpInfo GetMessage(int id)
 {
     IDataReader reader = DatabaseProvider.GetInstance().ShowHelp(id);
     HelpInfo info = null;
     if (reader != null)
     {
         if (reader.Read())
         {
             info = new HelpInfo();
             info.Title = reader["title"].ToString();
             info.Message = reader["message"].ToString();
             info.Pid = TypeConverter.ObjectToInt(reader["pid"]);
             info.Orderby = TypeConverter.ObjectToInt(reader["orderby"]);
         }
         reader.Close();
     }
     return info;
 }
Пример #4
0
        /// <summary>
        /// 获取帮助列表
        /// </summary>
        /// <returns>帮助列表</returns>
        public static List<HelpInfo> GetHelpList()
        {
            IDataReader reader = DatabaseProvider.GetInstance().GetHelpList();
            List<HelpInfo> helplist = new List<HelpInfo>();

            while (reader.Read())
            {
                HelpInfo info = new HelpInfo();
                info.Id = TypeConverter.ObjectToInt(reader["id"]);
                info.Title = reader["title"].ToString();
                info.Message = reader["message"].ToString();
                info.Pid = TypeConverter.ObjectToInt(reader["pid"]);
                info.Orderby = TypeConverter.ObjectToInt(reader["orderby"]);
                helplist.Add(info);
            }
            reader.Close();
            return helplist;
        }
Пример #5
0
 /// <summary>
 /// 获取帮助内容
 /// </summary>
 /// <param name="id"></param>
 /// <returns>帮助内容</returns>
 public static HelpInfo getmessage(int id)
 {
     IDataReader reader = DatabaseProvider.GetInstance().ShowHelp(id);
     HelpInfo info = new HelpInfo();
     if (reader != null)
     {
         if (reader.Read())
         {
             info.Title = reader["title"].ToString();
             info.Message = reader["message"].ToString();
             info.Pid = int.Parse(reader["pid"].ToString());
             info.Orderby = int.Parse(reader["orderby"].ToString());
             return info;
         }
         reader.Close();
     }
     return null;
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                helpinfo = Helps.GetMessage(id);

                if ((this.username != null) && (this.username != ""))
                {
                    if (id == 0)
                    {
                        return;
                    }
                    else
                    {
                        poster.Text = this.username;
                        orderby.Text = helpinfo.Orderby.ToString();
                        title.Text = helpinfo.Title;
                    }
                }
            }
        }