Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            id = 0;
            gnum(ref id, "id");
            if (!IsPostBack&&id>0)
            {
                Auto_pageDal au = new Auto_pageDal();
                Auto_pageInfo info = au.view(id);
                page_name.Text = info.page_name;
                setting.Value = info.setting;
                content.Value = info.content;
            }
            string app = gform("app");
            if (app == "add" && IsPostBack)
            {
                Auto_pageDal au = new Auto_pageDal();
                Auto_pageInfo info = new Auto_pageInfo();
                info.page_name = page_name.Text;
                info.setting = setting.Value;
                info.content = content.Value;

                au.add(info);
                showMessage("保存成功");
            }
        }
Esempio n. 2
0
 public bool add(Auto_pageInfo info)
 {
     DataSetAdd("auto_page", "page_name", info.page_name,
         "setting", info.setting,
         "content", info.content);
     return true;
 }
Esempio n. 3
0
 public bool edit(Auto_pageInfo info, string conditions)
 {
     DataSetEdit("auto_page", conditions,
         "page_name", info.page_name,
         "setting", info.setting,
         "content", info.content);
     return true;
 }
Esempio n. 4
0
        protected void btn_Click(object sender, EventArgs e)
        {
            Auto_pageDal au = new Auto_pageDal();
            Auto_pageInfo info = new Auto_pageInfo();
            info.page_name = page_name.Text;
            info.setting = setting.Value;
            info.content = content.Value;

            au.edit(info, id.ToString());
            showMessage("保存成功");
        }
Esempio n. 5
0
        public Auto_pageInfo view(int id)
        {
            DataSet ds = DataSetFind("auto_page", "id",id.ToString());
            Auto_pageInfo info = new Auto_pageInfo();
            if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count>0)
            {
                DataRow dr = ds.Tables[0].Rows[0];

                info.id = int.Parse(dr["id"].ToString());
                info.page_name = dr["page_name"].ToString();
                info.setting = dr["setting"].ToString();
                info.content = dr["content"].ToString();

            }
            return info;
        }
Esempio n. 6
0
 public List<Auto_pageInfo> read(params object[] obj)
 {
     List<Auto_pageInfo> list = new List<Auto_pageInfo>();
     DataSet ds = DataSetFind("auto_page",obj);
     if (ds.Tables.Count > 0)
     {
         foreach (DataRow dr in ds.Tables[0].Rows)
         {
             Auto_pageInfo info = new Auto_pageInfo();
             info.id = int.Parse(dr["id"].ToString());
             info.page_name = dr["page_name"].ToString();
             info.setting = dr["setting"].ToString();
             info.content = dr["content"].ToString();
             list.Add(info);
         }
     }
     return list;
 }
Esempio n. 7
0
 public Auto_pageBll(int id,string type)
 {
     Auto_pageDal ap = new Auto_pageDal();
     j_info = ap.view(id);
     j_type = type;
 }