예제 #1
0
        public RouteDataPreparationHelper(BenQGuru.eMES.Common.Domain.IDomainDataProvider dataProvider, DropDownList model, DropDownList item, DropDownList mo, DropDownList op)
        {
            this._model = model;
            this._item  = item;
            this._mo    = mo;
            this._op    = op;

            FacadeFactory fFac = new FacadeFactory(dataProvider);

            this._modelFacade = fFac.CreateModelFacade();
            this._moFacade    = fFac.CreateMOFacade();
            this._itemFacade  = fFac.CreateItemFacade();

            if (this._model != null)
            {
                this._model.SelectedIndexChanged += new EventHandler(_model_SelectedIndexChanged);
                this._model.AutoPostBack          = true;

                this._modelBuilder = new DropDownListBuilder(this._model);
                this._modelBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getModelList);
            }

            if (this._item != null)
            {
                this._item.SelectedIndexChanged += new EventHandler(_item_SelectedIndexChanged);
                this._item.AutoPostBack          = true;

                this._itemBuilder = new DropDownListBuilder(this._item);
                this._itemBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getItemList);
            }

            if (this._mo != null)
            {
                this._moBuilder = new DropDownListBuilder(this._mo);
                this._moBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getMOList);
            }

            if (this._op != null)
            {
                this._opBuilder = new DropDownListBuilder(this._op);
                this._opBuilder.HandleGetObjectList += new GetObjectListDelegate(this._getOperationList);
            }
        }
예제 #2
0
        private void BuildHtmlContent()
        {
            try
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();

                BenQGuru.eMES.BaseSetting.BaseModelFacade baseModelFacade = new FacadeFactory().CreateBaseModelFacade();
                object[] stepSequences = baseModelFacade.GetStepSequenceBySegmentCode(this.drpShiftCodeQuery.SelectedValue);


                sb.Append("<tr>");
                sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "产线"));
                if (stepSequences != null)
                {
                    for (int i = 0; i < stepSequences.Length; i++)
                    {
                        sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", ((BenQGuru.eMES.Domain.BaseSetting.StepSequence)stepSequences[i]).StepSequenceCode));
                    }
                }
                else
                {
                    sb.Append(string.Format("<td class='gridWebGrid-hc'  width='100%'>{0}</td>\n", "&nbsp;"));
                }
                sb.Append("</tr>\n");

                sb.Append("<tr>");
                sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "直通台数"));
                if (stepSequences != null)
                {
                    for (int i = 0; i < stepSequences.Length; i++)
                    {
                        sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 1));
                    }
                }
                else
                {
                    sb.Append(string.Format("<td class='gridWebGrid-ic' >{0}</td>\n", "&nbsp;"));
                }
                sb.Append("</tr>\n");

                sb.Append("<tr>");
                sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "总通过台数"));
                if (stepSequences != null)
                {
                    for (int i = 0; i < stepSequences.Length; i++)
                    {
                        sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 2));
                    }
                }
                else
                {
                    sb.Append(string.Format("<td class='gridWebGrid-ic' >{0}</td>\n", "&nbsp;"));
                }
                sb.Append("</tr>\n");

                sb.Append("<tr>");
                sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "产线直通率"));
                if (stepSequences != null)
                {
                    for (int i = 0; i < stepSequences.Length; i++)
                    {
                        sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 3));
                    }
                }
                else
                {
                    sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", "&nbsp;"));
                }
                sb.Append("</tr>\n");

                sb.Append("<tr>");
                sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "工段直通率"));
                if (stepSequences != null)
                {
                    for (int i = 0; i < stepSequences.Length; i++)
                    {
                        sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 4));
                    }
                }
                else
                {
                    sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", "&nbsp;"));
                }
                sb.Append("</tr>\n");

                this.HTMLContent = sb.ToString();
            }
            catch (Exception e)
            {
                BenQGuru.eMES.Common.ExceptionManager.Raise(null, e.Message, e);
            }
        }
예제 #3
0
        private void BuildHtmlContent()
        {
            try
            {
                System.Text.StringBuilder sb = new System.Text.StringBuilder();

                ReportFacade reportFacade = new FacadeFactory().CreateReportFacade();
                BenQGuru.eMES.BaseSetting.ShiftModelFacade shiftModelFacade = new FacadeFactory().CreateShiftModelFacade();
                object[] tps     = shiftModelFacade.GetTimePeriodByShiftCode(this.drpShiftCodeQuery.SelectedValue);
                object[] reports = reportFacade.QueryOPQty(this.drpSegmentCodeQuery.SelectedValue,
                                                           BenQGuru.eMES.Web.Helper.FormatHelper.TODateInt(this.dateStartDateQuery.Text),
                                                           this.drpShiftCodeQuery.SelectedValue,
                                                           this.drpStepSequenceCodeQuery.SelectedValue,
                                                           this.drpItemCodeQuery.SelectedValue,
                                                           this.drpModelQuery.SelectedValue,
                                                           this.drpMOCodeQuery.SelectedValue);
                if (tps == null)
                {
                    sb.Append("<tr>");
                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "产品别"));
                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "工单"));
                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "产线"));
                    sb.Append(string.Format("<td class='gridWebGrid-hc' colSpan='{0}' noWrap>{1}</td>\n", 1, "时段"));
                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "汇总"));
                    sb.Append("</tr>\n");
                }
                else
                {
                    sb.Append("<tr>");
                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "产品别"));
                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "工单"));
                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "产线"));
                    //sb.Append(string.Format("<td class='gridWebGrid-hc' colSpan='{0}' noWrap>{1}</td>\n", tps.Length, "时段"));
                    if (tps != null)
                    {
                        for (int i = 0; i < tps.Length; i++)
                        {
                            sb.Append(string.Format("<td class='gridWebGrid-hc' noWrap>{0} ~ {1}</td>\n",
                                                    BenQGuru.eMES.Web.Helper.FormatHelper.ToTimeString(((BenQGuru.eMES.Domain.BaseSetting.TimePeriod)tps[i]).TimePeriodBeginTime),
                                                    BenQGuru.eMES.Web.Helper.FormatHelper.ToTimeString(((BenQGuru.eMES.Domain.BaseSetting.TimePeriod)tps[i]).TimePeriodEndTime)
                                                    ));
                        }
                    }

                    sb.Append(string.Format("<td class='gridWebGrid-hc'>{0}</td>\n", "汇总"));
                    sb.Append("</tr>\n");
                }

                sb.Append("<tr>");
                sb.Append(string.Format("<td class='gridWebGrid-hc' colSpan='{0}'>{1}</td>\n", 3, "汇总"));

                //输出产量数据 -B

                //如果没有数据
                if (reports == null)
                {
                    if (tps != null)
                    {
                        for (int i = 0; i < tps.Length; i++)
                        {
                            sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 0));
                        }
                    }
                    else
                    {
                        sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 0));
                    }
                    sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 0));
                    sb.Append("</tr>\n");
                }
                //如果有数据
                else
                {
                    //1. 按 Model 分组
                    //2. 按 MO 分组
                    //1. 按 Line 分组
                    if (tps != null)
                    {
                        for (int i = 0; i < tps.Length; i++)
                        {
                            sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 0));
                        }
                    }
                    else
                    {
                        sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 0));
                    }
                    sb.Append(string.Format("<td class='gridWebGrid-ic'>{0}</td>\n", 0));
                    sb.Append("</tr>\n");
                }

                //输出产量数据 -E

                this.HTMLContent = sb.ToString();
            }
            catch (Exception e)
            {
                BenQGuru.eMES.Common.ExceptionManager.Raise(null, e.Message, e);
            }
        }