Пример #1
0
        protected override DataRow GetGridRow(object obj)
        {
            qty = (SMTRptLineQtyTimePeriod)obj;

            DataRow row = this.DtSource.NewRow();

            row["MOCode"]                = qty.MOCode;
            row["ItemCode"]              = qty.ProductCode;
            row["ShiftDay"]              = FormatHelper.ToDateString(qty.ShiftDay);
            row["TimePeriodCode"]        = qty.TPCode;
            row["TimePeriodDescription"] = qty.TPDescription;
            row["TargetQty"]             = String.Format("{0:#,#}", qty.CurrentQty);
            row["ActualQty"]             = String.Format("{0:#,#}", qty.ActualQty);
            row["DifferenceQty"]         = String.Format("{0:#,#}", qty.CurrentQty - qty.ActualQty);
            row["TPComPassRate"]         = Math.Round(qty.TPComPassRate * 100, 2).ToString() + " %";
            row["MaintainUser"]          = qty.MaintainUser;
            row["MaintainDate"]          = FormatHelper.ToDateString(qty.MaintainDate);
            row["MaintainTime"]          = FormatHelper.ToTimeString(qty.MaintainTime);
            //if (qty.ActualQty < qty.CurrentQty && qty.MaintainDate == 0)
            //{
            //    DateTime dtEnd = Convert.ToDateTime(FormatHelper.ToDateString(qty.Day) + " " + FormatHelper.ToTimeString(qty.TPEndTime));
            //    if (dtEnd < DateTime.Now)
            //    {
            //        row.Style.ForeColor = Color.Red;
            //    }
            //}
            return(row);
        }
Пример #2
0
        protected override string[] FormatExportRecord(object obj)
        {
            SMTRptLineQtyTimePeriod qty = (SMTRptLineQtyTimePeriod)obj;

            return(new string[] { qty.MOCode,
                                  qty.ProductCode,
                                  FormatHelper.ToDateString(qty.ShiftDay),
                                  qty.TPCode,
                                  qty.TPDescription,
                                  qty.CurrentQty.ToString(),
                                  qty.ActualQty.ToString(),
                                  (qty.CurrentQty - qty.ActualQty).ToString(),
                                  Math.Round(qty.TPComPassRate * 100, 2).ToString() + " %",
                                  qty.MaintainUser,
                                  FormatHelper.ToDateString(qty.MaintainDate),
                                  FormatHelper.ToTimeString(qty.MaintainTime) });
        }