using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class uc_task_WebUserControl : System.Web.UI.UserControl
{
    static string linkurl="~/china/TaskAdd.aspx";
    public string TaskLinkURL
    {
        set
        {
            linkurl = value.ToString().Trim();
        }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request["categoryID"] == null)
            {

                object RD = CDatabase.DBSelect("select * from TaksCategory where pid=0 order by sort");
                TaksDataList1.DataSource = RD;
                TaksDataList1.DataBind();
                CDatabase.CloseConn();
                //AddTaksSelectCategoryPanel.Visible = true;
                //ADDTaksPanel1.Visible = false;
            }
        }
    }

    protected string PICVIEW(string pic)
    {
        Task.FUNC t = new Task.FUNC();
        return t.filepath + pic;

    }
    protected string Link(string c, string i)
    {
        return linkurl + "?category=" + c + "&categoryid=" + i;

    }
    protected void TaksDataList1_ItemDataBound(object sender, DataListItemEventArgs e)
    {
        if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
        {



            //DataRowView dr = (DataRowView)e.Row.DataItem;
            DataList AddTaksDataList2 = (DataList)e.Item.FindControl("AddTaksDataList2");
            Label id = (Label)e.Item.FindControl("Label1");

            object RD = CDatabase.DBSelect("select * from TaksCategory where pid=" + id.Text);
            AddTaksDataList2.DataSource = RD;
            AddTaksDataList2.DataBind();
            CDatabase.CloseConn();
        }
    }
}
