Пример #1
0
        private void loaddata()
        {
            name.Text = DateTime.Now.ToShortDateString() + "填的单据";
            return_str();
            Maticsoft.BLL.account_detail ac_d = new BLL.account_detail();
            dt_all = ac_d.GetList(500, "", " id desc").Tables[0];
            DataTable dt = new DataTable();

            dt.Columns.Add("id", typeof(int));
            for (int i = 1; i < 6; i++)
            {
                DataRow row = dt.NewRow(); row["id"] = i; dt.Rows.Add(row);
            }
            GridView1.DataSource = dt;
            GridView1.DataBind();

            AccountsPrincipal user = new AccountsPrincipal(Context.User.Identity.Name);
            User currentUser       = new LTP.Accounts.Bus.User(user);

            //lururen.Text = currentUser.TrueName;


            Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1();
            DataSet       ds             = new DataSet();
            StringBuilder strWhere       = new StringBuilder();

            strWhere.Append("[start_time] < '");
            strWhere.Append(DateTime.Today.AddDays(30).Date.ToShortDateString());
            strWhere.Append("' and [end_time] > '");
            strWhere.Append(DateTime.Today.AddDays(-30).Date.ToShortDateString());
            strWhere.Append("'");
            ds = bll.GetList(strWhere.ToString());
            qishu.DataSource     = ds;
            qishu.DataTextField  = "name";
            qishu.DataValueField = "id";
            qishu.DataBind();

            Maticsoft.BLL.account account_bll = new BLL.account();
            DataSet ds2 = account_bll.lururen("");

            jingshouren.DataSource     = ds2;
            jingshouren.DataTextField  = "lururen";
            jingshouren.DataValueField = "lururen";
            jingshouren.DataBind();
            for (int i = 0; i < jingshouren.Items.Count; i++)
            {
                if (jingshouren.Items[i].Value.Trim() == currentUser.TrueName)
                {
                    jingshouren.Items[i].Selected = true;
                }
            }
            //jingshouren.SelectedValue = currentUser.TrueName;
            luru_time.Text = DateTime.Now.ToShortDateString();
        }
        private void loaddata()
        {
            Maticsoft.BLL.account_view acc_bll = new BLL.account_view();
            GridView1.DataSource = acc_bll.GetList(100, "", "detail_id");
            GridView1.DataBind();

            Maticsoft.BLL.peixunban1 bll = new Maticsoft.BLL.peixunban1();
            DataSet       ds             = new DataSet();
            StringBuilder strWhere       = new StringBuilder();

            strWhere.Append("[start_time] < '");
            strWhere.Append(DateTime.Today.AddDays(30).Date.ToShortDateString());
            strWhere.Append("' and [end_time] > '");
            strWhere.Append(DateTime.Today.AddDays(-30).Date.ToShortDateString());
            strWhere.Append("'");
            ds = bll.GetList(strWhere.ToString());
            DataRow newrow = ds.Tables[0].NewRow();

            newrow["id"]   = "999";
            newrow["name"] = "—全部显示—";
            ds.Tables[0].Rows.Add(newrow);
            qishu.DataSource     = ds;
            qishu.DataTextField  = "name";
            qishu.DataValueField = "id";
            qishu.DataBind();
            Maticsoft.BLL.account account_bll = new BLL.account();
            DataSet ds2     = account_bll.lururen("");
            DataRow newrow2 = ds2.Tables[0].NewRow();

            newrow2["lururen"] = "—全部显示—";
            ds2.Tables[0].Rows.Add(newrow2);
            lururen.DataSource     = ds2;
            lururen.DataTextField  = "lururen";
            lururen.DataValueField = "lururen";
            lururen.DataBind();
        }