Ejemplo n.º 1
0
    private void Init_theSchedule()
    {
        this._DtSchedule.Columns.Add(new DataColumn("ParentTaskCode", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("TaskCode", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("TaskName", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("ChildNum", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("WorkLayer", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("Unit", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("Quantity", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("MonthOverQuantity", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("AccumulativeQuantity", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("SynthPrice", typeof(string)));
        this._DtSchedule.Columns.Add(new DataColumn("ProductValue", typeof(string)));
        ArrayList arrayList = new ArrayList();

        arrayList = this.ProductValueAct.ProductValueMonthStatWeave(this.ProjectCode, this.StartDate);
        for (int i = 0; i < arrayList.Count; i++)
        {
            DataRow dataRow = this._DtSchedule.NewRow();
            MonthProductValueDetail monthProductValueDetail = (MonthProductValueDetail)arrayList[i];
            dataRow["ParentTaskCode"]       = monthProductValueDetail.TaskList.ParentTaskCode;
            dataRow["TaskCode"]             = monthProductValueDetail.TaskList.TaskCode;
            dataRow["TaskName"]             = monthProductValueDetail.TaskList.TaskName;
            dataRow["ChildNum"]             = ((monthProductValueDetail.TaskList.ChildNum > 0) ? "true" : "false");
            dataRow["WorkLayer"]            = monthProductValueDetail.TaskList.WorkLayer.ToString();
            dataRow["Unit"]                 = monthProductValueDetail.Unit;
            dataRow["Quantity"]             = monthProductValueDetail.Quantity.ToString();
            dataRow["MonthOverQuantity"]    = monthProductValueDetail.MonthOverQuantity.ToString();
            dataRow["AccumulativeQuantity"] = monthProductValueDetail.AccumulativeQuantity.ToString();
            dataRow["SynthPrice"]           = monthProductValueDetail.SynthPrice.ToString();
            dataRow["ProductValue"]         = monthProductValueDetail.ProductValue.ToString();
            this._DtSchedule.Rows.Add(dataRow);
        }
    }
Ejemplo n.º 2
0
    private ArrayList GetTable_Data()
    {
        ArrayList arrayList = new ArrayList();

        for (int i = 1; i < this.tblScheduleView.Rows.Count; i++)
        {
            MonthProductValueDetail monthProductValueDetail = new MonthProductValueDetail();
            monthProductValueDetail.TaskList.ProjectCode = this.ProjectCode;
            monthProductValueDetail.TaskList.TaskCode    = this.tblScheduleView.Rows[i].Cells[8].Text;
            monthProductValueDetail.StatDate             = DateTime.Now;
            monthProductValueDetail.Unit = this.tblScheduleView.Rows[i].Cells[1].Text;
            if (this.tblScheduleView.Rows[i].Cells[7].Text == "3")
            {
                monthProductValueDetail.Quantity             = Convert.ToDecimal(this.tblScheduleView.Rows[i].Cells[2].Text);
                monthProductValueDetail.MonthOverQuantity    = Convert.ToDecimal(((TextBox)this.tblScheduleView.Rows[i].Cells[3].Controls[0]).Text);
                monthProductValueDetail.AccumulativeQuantity = Convert.ToDecimal(this.tblScheduleView.Rows[i].Cells[4].Text);
                monthProductValueDetail.SynthPrice           = Convert.ToDecimal(this.tblScheduleView.Rows[i].Cells[5].Text);
                monthProductValueDetail.ProductValue         = Convert.ToDecimal(((TextBox)this.tblScheduleView.Rows[i].Cells[3].Controls[0]).Text) * Convert.ToDecimal(this.tblScheduleView.Rows[i].Cells[5].Text);
            }
            else
            {
                monthProductValueDetail.Quantity             = 0m;
                monthProductValueDetail.MonthOverQuantity    = 0m;
                monthProductValueDetail.AccumulativeQuantity = 0m;
                monthProductValueDetail.SynthPrice           = 0m;
                monthProductValueDetail.ProductValue         = 0m;
            }
            arrayList.Add(monthProductValueDetail);
        }
        return(arrayList);
    }
Ejemplo n.º 3
0
        private MonthProductValueDetail GetMonthProductValueDetailFromDataRow(DataRow dr)
        {
            MonthProductValueDetail detail = new MonthProductValueDetail {
                Quantity             = (dr["Quantity"].ToString() == "") ? 0M : Convert.ToDecimal(dr["Quantity"].ToString()),
                MonthOverQuantity    = (dr["MonthOverQuantity"].ToString() == "") ? 0M : Convert.ToDecimal(dr["MonthOverQuantity"].ToString()),
                AccumulativeQuantity = (dr["AccumulativeQuantity"].ToString() == "") ? 0M : Convert.ToDecimal(dr["AccumulativeQuantity"].ToString()),
                SynthPrice           = (dr["SynthPrice"].ToString() == "") ? 0M : Convert.ToDecimal(dr["SynthPrice"].ToString()),
                ProductValue         = (dr["ProductValue"].ToString() == "") ? 0M : Convert.ToDecimal(dr["ProductValue"].ToString()),
                ReportQuantity       = (dr["ReportQuantity"].ToString() == "") ? 0M : Convert.ToDecimal(dr["ReportQuantity"].ToString()),
                SuperQuantity        = (dr["SuperQuantity"].ToString() == "") ? 0M : Convert.ToDecimal(dr["SuperQuantity"].ToString()),
                AccSuperQuantity     = (dr["AccSuperQuantity"].ToString() == "") ? 0M : Convert.ToDecimal(dr["AccSuperQuantity"].ToString())
            };

            try
            {
                detail.PlanOverQuantity = Convert.ToDecimal(dr["PlanOverQuantity"].ToString());
            }
            catch
            {
            }
            try
            {
                detail.PlanAccumulativeQuantity = Convert.ToDecimal(dr["PlanAccumulativeQuantity"].ToString());
            }
            catch
            {
            }
            try
            {
                detail.PlanProductValue = Convert.ToDecimal(dr["PlanProductValue"].ToString());
            }
            catch
            {
            }
            detail.Unit = dr["Unit"].ToString();
            detail.TaskList.ProjectCode    = new Guid(dr["ProjectCode"].ToString());
            detail.TaskList.ParentTaskCode = dr["ParentTaskCode"].ToString();
            detail.TaskList.TaskCode       = dr["TaskCode"].ToString();
            detail.TaskList.TaskName       = dr["TaskName"].ToString();
            detail.TaskList.WorkLayer      = (int)dr["WorkLayer"];
            detail.TaskList.ChildNum       = (int)dr["ChildNum"];
            return(detail);
        }