Exemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        startDate               = DateTime.Today.ToString("yyyy/MM/dd");
        connectionString        = @"Server=" + SERVER + @";Database=" + DATABASE + @";Uid=" + UID + @";Pwd=" + PWD;
        DataLayer               = new clsDataLayer();
        username                = Session["sessionUserID"].ToString();
        usernameLabel.InnerText = username;

        // TODO: move code in to this method
        //GetCategoryTypes();


        //loads categories
        clsDataLayer cls;

        if (!IsPostBack)
        {
            cls = new clsDataLayer();
            dropdownCategoryTypes.DataSource     = cls.GetCategoryTypes((string)Session["sessionUserID"]);
            dropdownCategoryTypes.DataTextField  = "CatName";
            dropdownCategoryTypes.DataValueField = "CatID";
            dropdownCategoryTypes.DataBind();
            dropdownCategoryTypes.Items.Insert(0, new ListItem("--Select Category--", "0"));
            getChartData(username);
        }
        else
        {
        }
    }
Exemplo n.º 2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            clsDataLayer cls = new clsDataLayer();
            Tuple <int, String, String> catInfo = cls.GetCategoryDetails(Int32.Parse(Session["UpdateCatID"].ToString()));

            DataTable dt = cls.GetCategoryTypes(Session["sessionUserID"].ToString());
            txbxCatName.Text = catInfo.Item2;
            txbxCatDesc.Text = catInfo.Item3;
        }
    }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        clsDataLayer cdl;

        if (!IsPostBack)
        {
            cdl = new clsDataLayer();
            lstCategoryNames.DataSource     = cdl.GetCategoryTypes((string)Session["sessionUserID"]);
            lstCategoryNames.DataTextField  = "CatName";
            lstCategoryNames.DataValueField = "CatID";
            lstCategoryNames.DataBind();
        }
    }
Exemplo n.º 4
0
    protected void GetCategoryTypes()
    {
        if (!IsPostBack)
        {
            clsDataLayer cls = new clsDataLayer();
            //DatacatInfo = cls.GetCategoryDetails( username);

            DataTable dt = cls.GetCategoryTypes(username);
            //dropdownCategoryTypes.Text =


            //ddlTeamLead.DataSource = cmd.ExecuteReader();
            dropdownCategoryTypes.DataSource     = dt;
            dropdownCategoryTypes.DataTextField  = "TeamLead";
            dropdownCategoryTypes.DataValueField = "TeamLead";
            //dropdownCategoryTypes.DataBind();
            //ddlTeamLead.DataBind();
        }
    }