Exemple #1
0
    private void KndGridBinding()
    {
        Biz_PositionKinds positionKinds = new Biz_PositionKinds();

        DataSet ds = positionKinds.GetPositionKinds();

        UltraWebGrid1.DataSource = ds;
        UltraWebGrid1.DataBind();
    }
    public static void BindPositionKind(DropDownList ddl, bool isDefault)
    {
        Biz_PositionKinds position = new Biz_PositionKinds();
        DataSet           ds       = position.GetPositionKinds();

        ddl.DataValueField = "POS_KND_ID";
        ddl.DataTextField  = "POS_KND_NAME";
        ddl.DataSource     = ds;
        ddl.DataBind();

        if (isDefault)
        {
            ListItem itemA = new ListItem("----------", "-");
            ddl.Items.Insert(0, itemA);
        }
    }
Exemple #3
0
    public static void BindKndBiz(TreeView treeView)
    {
        string valueStr_knd = "POS_KND_ID";
        string textStr_knd  = "POS_KND_NAME";
        string valueStr_biz = "POS_BIZ_ID";
        string textStr_biz  = "POS_BIZ_NAME";

        string imageUrlDir = "../images/dept_icon/";

        Biz_PositionKinds posKind = new Biz_PositionKinds();
        DataTable         dtKnd   = posKind.GetPositionKinds().Tables[0];

        Biz_PositionKindBizMaps posKndBiz = new Biz_PositionKindBizMaps();
        DataTable dtKndBiz = posKndBiz.GetPosKndBizMaps().Tables[0];

        TreeNode rootNode = CreateNode("", "Root", imageUrlDir + "purple/R.gif", true, TreeNodeSelectAction.None, false);

        treeView.Nodes.Add(rootNode);

        foreach (DataRow dbRowKnd in dtKnd.Rows)
        {
            TreeNode newNode = CreateNode(dbRowKnd[valueStr_knd].ToString()
                                          , dbRowKnd[textStr_knd].ToString()
                                          , imageUrlDir + "blue/k.gif"
                                          , false
                                          , TreeNodeSelectAction.Expand
                                          , false);

            rootNode.ChildNodes.Add(newNode);

            DataRow[] drArrBiz = dtKndBiz.Select(string.Format(@"POS_KND_ID = '{0}'", dbRowKnd["POS_KND_ID"]));

            foreach (DataRow drBiz in drArrBiz)
            {
                TreeNode newChildNode = CreateNode(drBiz[valueStr_biz].ToString()
                                                   , drBiz[textStr_biz].ToString()
                                                   , imageUrlDir + "red/b.gif"
                                                   , false
                                                   , TreeNodeSelectAction.Select
                                                   , false);

                newNode.ChildNodes.Add(newChildNode);
            }
        }
    }