예제 #1
0
    protected void Bind()
    {
        BannerInfo                info    = bBLL.GetDataById(id);
        BannerLocationInfo        blinfo  = blBLL.GetDataById(info.bl_id);
        List <BannerLocationInfo> blinfos = blBLL.GetAllUpSortData(blinfo.bl_father_id);

        blinfo.bl_title = " → " + blinfo.bl_title;
        blinfos.Add(blinfo);
        lbCategory.Text = bcBLL.GetDataById(info.bc_id).bc_title;
        foreach (BannerLocationInfo Fblinfo in blinfos)
        {
            lbLocation.Text += Fblinfo.bl_title;
        }
        lbCustomer.Text = bcsBLL.GetDataById(info.bcs_id).bcs_company_name;
        lbTitle.Text    = info.b_title;
        lbWebUrl.Text   = info.b_url;
        lbPrice.Text    = info.b_price.ToString();
        lbProb.Text     = info.b_prob.ToString();
        if (info.b_target == "_blank")
        {
            lbTarget.Text = "開新頁顯示";
        }
        else
        {
            lbTarget.Text = "本頁顯示";
        }
        lbHits.Text        = info.b_hits.ToString();
        lbCreateDate.Text  = info.b_ts.ToString("yyyy/MM/dd");
        lbEditDate.Text    = info.b_editDate.ToString("yyyy/MM/dd");
        lbStartDate.Text   = info.b_startDate.ToString("yyyy/MM/dd");
        lbEndDate.Text     = info.b_endDate.ToString("yyyy/MM/dd");
        rpImage.DataSource = bpBLL.GetDataByBid(id);
        rpImage.DataBind();
    }
예제 #2
0
    public string getTitle(int id)
    {
        if (id == 0)
        {
            return("此資料為頁面");
        }
        BannerLocationInfo info = blBLL.GetDataById(id);

        return(info.bl_title);
    }
예제 #3
0
        private void SearchHierarchyVailNow(int bl_fid)
        {
            BannerLocationInfo info = GetDataById(bl_fid);

            if (info.bl_id != 0)
            {
                HerichCountMath += 1;
                SearchHierarchyVailNow(info.bl_father_id);
            }
        }
예제 #4
0
        public BannerLocationInfo GetDataById(int bl_id)
        {
            BannerLocationInfo info   = new BannerLocationInfo();
            IDataReader        reader = db.GetDataById(bl_id).CreateDataReader();

            if (reader.Read())
            {
                info = BannerLocationInfo.Populate(reader);
            }
            return(info);
        }
예제 #5
0
        public List <BannerLocationInfo> GetDataByFatherId(int fatherId)
        {
            List <BannerLocationInfo> infos = new List <BannerLocationInfo>();
            IDataReader reader = db.GetDataByFatherId(fatherId).CreateDataReader();

            while (reader.Read())
            {
                infos.Add(BannerLocationInfo.Populate(reader));
            }
            return(infos);
        }
예제 #6
0
        public List <BannerLocationInfo> GetAllUpSortData(int fatherId)
        {
            BannerLocationInfo info = GetDataById(fatherId);

            if (info.bl_id != 0)
            {
                result.Add(info);
                GetAllUpSortData(info.bl_father_id);
            }
            return(result);
        }
예제 #7
0
    protected void InsertData()
    {
        BannerLocationInfo info = new BannerLocationInfo();

        info.bl_father_id = Tools.TryParseMethod(ddlCategory.SelectedValue);
        info.bl_title     = txtName.Text;
        info.bl_show      = bool.Parse(rbShow.SelectedValue);
        if (blBLL.Insert(info) > 0)
        {
            Response.Redirect("List.aspx?header=" + Getmessage("30009"));
        }
    }
예제 #8
0
 protected void Bind()
 {
     if (id != 0)
     {
         if (Tools.TryParseMethod(id.ToString()) != 0)
         {
             BannerLocationInfo info = blBLL.GetDataById(id);
             ddlCategory.SelectedValue = info.bl_father_id.ToString();
             txtName.Text         = info.bl_title;
             rbShow.SelectedValue = info.bl_show.ToString();
         }
     }
 }
예제 #9
0
    protected void InsertData()
    {
        BannerLocationInfo info = blBLL.GetDataById(id);

        info.bl_title     = txtName.Text;
        info.bl_father_id = Tools.TryParseMethod(ddlCategory.SelectedValue);
        info.bl_show      = bool.Parse(rbShow.SelectedValue);
        if (blBLL.Update(info) > 0)
        {
            Response.Redirect("List.aspx?header=" + Getmessage("30014"));
            return;
        }
        ShowMessage("更新失敗: 更新類別不可為自身、不可為自身以下的子類別");
    }
예제 #10
0
        public bool SearchHierarchyEqualVail(int id, int Hierarchy)
        {
            BannerLocationInfo info = GetDataById(id);

            if (info.bl_id != 0)
            {
                SearchHierarchyVailNow(info.bl_father_id);
            }
            if (Hierarchy == HerichCountMath)
            {
                return(true);
            }
            return(false);
        }
예제 #11
0
 public int Update(BannerLocationInfo info)
 {
     return(db.Update(info.bl_title, info.bl_father_id, info.bl_show, info.bl_id));
 }
예제 #12
0
 public int Insert(BannerLocationInfo info)
 {
     return(db.Insert(info.bl_title, info.bl_father_id, info.bl_show));
 }