Пример #1
0
        /// <summary>
        /// 加载所属预算
        /// </summary>
        protected void ShowParentBudgetList(string userid)
        {
            try
            {
                DataTable DT = new DataTable();
                //我负责的预算
                //string sql1 = " SELECT * FROM budget WHERE  (charindex('"+ common.SafeString(userid) + "',ManagerIDs)>0)";

                string sql1 = " SELECT * FROM budget WHERE  ( ParentId is null or ParentId = 0)";

                DT = pageControl.doSql(sql1).Tables[0];

                if (DT.Rows.Count > 0)
                {
                    DDL_Budget.DataSource     = DT;
                    DDL_Budget.DataValueField = "ID";
                    DDL_Budget.DataTextField  = "BudgetName";
                    DDL_Budget.DataBind();
                }
                else
                {
                    ListItem li = new ListItem("-暂无可选项目-", "");
                    // DDL_Project.Items.Add(li);
                }
            }
            catch
            { }
        }
Пример #2
0
        /// <summary>
        /// 获取所属预算报告列表
        /// </summary>
        private void GetDDLBudget()
        {
            try
            {
                DDL_Budget.Items.Clear();
                DataTable DT  = new DataTable();
                string    sql = "SELECT ID, NAMES FROM Cash_SF_Order WHERE (Delflag = 0) AND (Status = 1) ORDER BY ADDTIME DESC ";
                DT = pageControl.doSql(sql).Tables[0];
                if (DT.Rows.Count > 0)
                {
                    DDL_Budget.DataSource     = DT;
                    DDL_Budget.DataTextField  = "NAMES";
                    DDL_Budget.DataValueField = "ID";
                    DDL_Budget.DataBind();
                }
                else
                {
                    ListItem li = new ListItem("-暂无预算报告-", "");
                    DDL_Budget.Items.Add(li);

                    //没有预算报告不能创建资金卡
                    Button_sumbit.Enabled = false;
                    tag.Text = "暂无预算报告,不能创建资金卡!";
                }
            }
            catch
            { }
        }