Ejemplo n.º 1
0
    private string GetIncometContractName(string contractID)
    {
        IncometContract      incometContract = new IncometContract();
        IncometContractModel model           = incometContract.GetModel(contractID);

        if (model != null)
        {
            return(model.ContractName);
        }
        return(string.Empty);
    }
Ejemplo n.º 2
0
    private void DataBindList()
    {
        IncometContract incometContract = new IncometContract();
        string          text            = base.Request.QueryString["prjCode"];
        DataTable       dataTable       = null;
        decimal         d  = 0m;
        decimal         d2 = 0m;
        decimal         d3 = 0m;
        decimal         d4 = 0m;

        if (!string.IsNullOrEmpty(text))
        {
            string text2 = string.Empty;
            if (!string.IsNullOrEmpty(this.txtCode.Text.Trim()))
            {
                text2 = text2 + " AND taskCode LIKE '%" + this.txtCode.Text.Trim() + "%' ";
            }
            if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
            {
                text2 = text2 + " AND taskName LIKE '%" + this.txtName.Text.Trim() + "%' ";
            }
            string beginTime = System.DateTime.Now.ToString("yyyy-MM") + "-01";
            string endTime   = System.DateTime.Now.AddMonths(1).ToString("yyyy-MM") + "-01";
            dataTable = incometContract.GetMonthStatistics(text, beginTime, endTime, text2);
            if (dataTable.Rows.Count > 0)
            {
                foreach (DataRow dataRow in dataTable.Rows)
                {
                    d  += System.Convert.ToDecimal(dataRow["Total"]);
                    d2 += System.Convert.ToDecimal(dataRow["MTotal"]);
                    d3 += System.Convert.ToDecimal(dataRow["CAmount"]);
                    d4 += System.Convert.ToDecimal(dataRow["TAmount"]);
                    if (dataRow["ModifyType"].ToString() == "0")
                    {
                        dataRow["Total"]    = 0;
                        dataRow["Quantity"] = 0;
                    }
                }
            }
        }
        this.hfldPreTotal.Value                = d.ToString();
        this.hfldCurTotal.Value                = d2.ToString();
        this.hfldCueMonthTotal.Value           = d3.ToString();
        this.hfldAggregateTotal.Value          = d4.ToString();
        this.ViewState["dt"]                   = dataTable;
        this.gvwPrjBudgetStatistics.DataSource = dataTable;
        this.gvwPrjBudgetStatistics.DataBind();
    }