Example #1
0
    //===================================: 비용관리 조회
    private void SetBudgetGrid()
    {
        Biz_Prj_Info     objPrj      = new Biz_Prj_Info(this.IPrjRefID);
        Biz_Prj_Resource prjResource = new Biz_Prj_Resource();
        Biz_Prj_Budget   objBud      = new Biz_Prj_Budget();

        if (this.IPrjRefID == 0)
        {
            return;
        }

        DataSet   ds      = objBud.SelectMonthRateList(this.IPrjRefID);
        DataTable dt      = objBud.GetDataTableSchema();
        DateTime  dtStart = DataTypeUtility.GetToDateTime(objPrj.IPlan_Start_Date);
        DateTime  dtEnd   = DataTypeUtility.GetToDateTime(objPrj.IPlan_End_Date);

        for (DateTime date = dtStart; date <= dtEnd;)
        {
            TOTAL_CNT++;

            DataRow dataRow = null;

            dataRow = GetBudGetYM(ds.Tables[0], date.ToString("yyyyMM"));

            if (dataRow == null)
            {
                dataRow = dt.NewRow();

                dataRow["ITYPE"]          = "A";
                dataRow["PRJ_REF_ID"]     = this.IPrjRefID;
                dataRow["BUDGET_YM"]      = date.ToString("yyyyMM");
                dataRow["BUDGET_YM_NAME"] = date.ToString("yyyy년 MM월");
                dataRow["MONTHLY_AMOUNT"] = 0;
                dataRow["AMOUNT"]         = 0;
                dataRow["RATE"]           = 0;

                dt.Rows.Add(dataRow);
            }
            else
            {
                dt.ImportRow(dataRow);
            }

            date = date.AddMonths(1);
        }

        grdBudgetList.DataSource = dt.DefaultView;
        grdBudgetList.DataBind();

        lblTOTAL_MONTHLY_AMOUNT.Text = TOTAL_MONTHLY_AMOUNT.ToString("###,##0");
        lblTOTAL_AMOUNT.Text         = TOTAL_AMOUNT.ToString("###,##0");

        decimal tmpVar = (TOTAL_RATE / TOTAL_CNT);

        lblTOTAL_RATE.Text = tmpVar.ToString("##0.#0");
    }
Example #2
0
    public void SetFormData()
    {
        Biz_Prj_Info     objPrj      = new Biz_Prj_Info(this.IPrjRefID);
        Biz_Prj_Resource prjResource = new Biz_Prj_Resource();
        Biz_Prj_Budget   objBud      = new Biz_Prj_Budget();

        this.IApp_Ref_Id = objPrj.IApp_Ref_Id;
        txtPRJ_CODE.Text = objPrj.IPrj_Code;
        txtPRJ_NAME.Text = objPrj.IPrj_Name;
        this.IDraftEmpID = objPrj.IOwner_Emp_Id;


        if (this.IPrjRefID == 0)
        {
            return;
        }


        lblPrjPeriod.Text = DataTypeUtility.GetToDateTime(objPrj.IPlan_Start_Date).ToShortDateString() + " ~ " + DataTypeUtility.GetToDateTime(objPrj.IPlan_End_Date).ToShortDateString();

        this.ITotalBudget         = objPrj.ITotal_Budget;
        lblTotalBudgetAmount.Text = this.ITotalBudget.ToString("###,##0");


        ugrdBudgetList.Clear();

        DataSet   ds      = objBud.SelectMonthRateList(this.IPrjRefID);
        DataTable dt      = objBud.GetDataTableSchema();
        DateTime  dtStart = DataTypeUtility.GetToDateTime(objPrj.IPlan_Start_Date);
        DateTime  dtEnd   = DataTypeUtility.GetToDateTime(objPrj.IPlan_End_Date);


        for (DateTime date = dtStart; date <= dtEnd;)
        {
            DataRow dataRow = null;

            dataRow = GetBudGetYM(ds.Tables[0], date.ToString("yyyyMM"));

            if (dataRow == null)
            {
                dataRow = dt.NewRow();

                dataRow["ITYPE"]          = "A";
                dataRow["PRJ_REF_ID"]     = this.IPrjRefID;
                dataRow["BUDGET_YM"]      = date.ToString("yyyyMM");
                dataRow["BUDGET_YM_NAME"] = date.ToString("yyyy년 MM월");
                dataRow["MONTHLY_AMOUNT"] = 0;
                dataRow["AMOUNT"]         = 0;
                dataRow["RATE"]           = DBNull.Value;

                dt.Rows.Add(dataRow);
            }
            else
            {
                dt.ImportRow(dataRow);
            }

            date = date.AddMonths(1);
        }

        ugrdBudgetList.DataSource = dt;
        ugrdBudgetList.DataBind();
    }