示例#1
0
    public void BindGv()
    {
        this.AspNetPager1.PageSize = NBasePage.pagesize;
        string  person      = this.txtPerson.Text.Trim();
        string  empty       = string.Empty;
        string  text        = this.txtStartDate.Text;
        string  text2       = this.txtEndDate.Text;
        string  deparment   = this.txtDeparment.Text.Trim();
        decimal?totalAmount = null;
        decimal?endCash     = null;
        string  name        = this.txtName.Text.Trim();

        if (!string.IsNullOrEmpty(this.txtTotalAmount.Text))
        {
            totalAmount = new decimal?(System.Convert.ToDecimal(this.txtTotalAmount.Text));
        }
        if (!string.IsNullOrEmpty(this.txtEndCash.Text))
        {
            endCash = new decimal?(System.Convert.ToDecimal(this.txtEndCash.Text));
        }
        int       count   = CostDiary.GetCount(this.prjId, person, text, text2, empty, deparment, this.txtName.Text, this.ddlFlowState.SelectedValue, totalAmount, endCash, this.costType);
        DataTable diaries = CostDiary.GetDiaries(this.prjId, person, text, text2, empty, deparment, this.txtName.Text, this.ddlFlowState.SelectedValue, totalAmount, endCash, this.costType, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);

        this.AspNetPager1.RecordCount = count;
        this.ViewState["Diaries"]     = diaries;
        this.gvBudget.DataSource      = diaries;
        this.gvBudget.DataBind();
        this.hfldPurchaseChecked.Value = string.Empty;
        if (this.gvBudget.Rows.Count > 0)
        {
            base.RegisterScript("fillTotalAmount('" + CostDiary.GetDiariesTotal(this.prjId, person, empty, name, this.ddlFlowState.SelectedValue, text, text2, deparment, this.costType, totalAmount, endCash).ToString("#,##0.000") + "');showDetails();");
            return;
        }
        base.RegisterScript("showDetails();");
    }
示例#2
0
    public void BindGv2(string prjId)
    {
        string text  = new System.DateTime(1753, 1, 1).ToString();
        string text2 = new System.DateTime(9999, 12, 31).ToString();

        this.AspNetPager3.PageSize = NBasePage.pagesize;
        //string person = this.txtPerson.Text.Trim();
        //string userName = string.Empty;
        //if (base.UserCode != "00000000")
        //{
        //    userName = WebUtil.GetUserNames(base.UserCode);
        //}
        //string text = this.txtStartDate.Text;
        //string text2 = this.txtEndDate.Text;
        //string deparment = this.txtDeparment.Text.Trim();
        //string name = this.txtName.Text.Trim();
        decimal?totalAmount = null;
        decimal?endCash     = null;
        //if (!string.IsNullOrEmpty(this.txtTotalAmount.Text))
        //{
        //    totalAmount = new decimal?(System.Convert.ToDecimal(this.txtTotalAmount.Text));
        //}
        //if (!string.IsNullOrEmpty(this.txtEndCash.Text))
        //{
        //    endCash = new decimal?(System.Convert.ToDecimal(this.txtEndCash.Text));
        //}
        //int count = CostDiary.GetCount(this.prjId, person, text, text2, userName, deparment, this.txtName.Text, this.ddlFlowState.SelectedValue, totalAmount, endCash, this.costType);
        //DataTable diaries = CostDiary.GetDiaries(this.prjId, person, text, text2, userName, deparment, this.txtName.Text, this.ddlFlowState.SelectedValue, totalAmount, endCash, this.costType, this.AspNetPager1.PageSize, this.AspNetPager1.CurrentPageIndex);
        int       count   = CostDiary.GetCount(prjId, "", text, text2, "", "", "", "", totalAmount, endCash, "P");
        DataTable diaries = CostDiary.GetDiaries(prjId, "", text, text2, "", "", "", "", totalAmount, endCash, "P", this.AspNetPager3.PageSize, this.AspNetPager3.CurrentPageIndex);

        this.AspNetPager3.RecordCount = count;
        this.gvBudget.DataSource      = diaries;
        this.gvBudget.DataBind();
        //this.hfldPurchaseChecked.Value = string.Empty;
        if (this.gvBudget.Rows.Count > 0)
        {
            //base.RegisterScript("fillTotalAmount('" + CostDiary.GetDiariesTotal(this.prjId, person, userName, name, this.ddlFlowState.SelectedValue, text, text2, deparment, this.costType, totalAmount, endCash).ToString("#,##0.000") + "');showDetails();");
            //base.RegisterScript("fillTotalAmount('" + CostDiary.GetDiariesTotal(prjId, "", text, text2, "", "", "", "", "P", totalAmount, endCash).ToString("#,##0.000") + "');showDetails();");
            return;
        }
        //base.RegisterScript("showDetails();");
    }