예제 #1
0
        private void drpMoTypeQuery_Load(object sender, System.EventArgs e)
        {
            if (!this.IsPostBack)
            {
                //update by crystal chu 2005/04/22
                SystemParameterListBuilder _builder = new SystemParameterListBuilder("MOTYPE", base.DataProvider);
                _builder.Build(this.drpMoTypeQuery);
                _builder.AddAllItem(languageComponent1);


                SystemSettingFacade sysFacade  = new SystemSettingFacade(this.DataProvider);
                object[]            moTypeList = sysFacade.GetParametersByParameterGroup("MOTYPE");

                drpMoTypeQuery.Items.Clear();
                drpMoTypeQuery.Items.Add(new ListItem("", ""));

                if (moTypeList != null)
                {
                    foreach (BenQGuru.eMES.Domain.BaseSetting.Parameter param in moTypeList)
                    {
                        string showText = this.languageComponent1.GetString(param.ParameterValue.Trim().ToUpper());
                        bool   found    = false;
                        foreach (ListItem item in drpMoTypeQuery.Items)
                        {
                            if (item.Text.Trim().ToUpper() == showText)
                            {
                                item.Value += "," + param.ParameterCode;
                                found       = true;
                                break;
                            }
                        }
                        if (!found)
                        {
                            drpMoTypeQuery.Items.Add(new ListItem(showText, param.ParameterCode));
                        }
                    }
                }
            }
        }
예제 #2
0
        private void InitENV()
        {
            if (_facade == null)
            {
                _facade = new MOFacade(base.DataProvider);
            }
            string action = Request.QueryString["ACT"].Trim();

            MO mo = (MO)(this._facade.GetMO(this.GetMOCode()));

            this.ViewState["itemcode"] = mo.ItemCode;

            #region reset status list

            this.drpMOStatusEdit.Items.Clear();
            switch (mo.MOStatus)
            {
            case MOManufactureStatus.MOSTATUS_INITIAL:
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_INITIAL), MOManufactureStatus.MOSTATUS_INITIAL));
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_RELEASE), MOManufactureStatus.MOSTATUS_RELEASE));
                SetInputEnable(true, MOManufactureStatus.MOSTATUS_INITIAL);
                break;

            case MOManufactureStatus.MOSTATUS_RELEASE:
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_INITIAL), MOManufactureStatus.MOSTATUS_INITIAL));
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_RELEASE), MOManufactureStatus.MOSTATUS_RELEASE));
                SetInputEnable(false, MOManufactureStatus.MOSTATUS_RELEASE);
                break;

            case MOManufactureStatus.MOSTATUS_OPEN:
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_OPEN), MOManufactureStatus.MOSTATUS_OPEN));
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_CLOSE), MOManufactureStatus.MOSTATUS_CLOSE));
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_PENDING), MOManufactureStatus.MOSTATUS_PENDING));
                SetInputEnable(false, MOManufactureStatus.MOSTATUS_OPEN);
                break;


            case MOManufactureStatus.MOSTATUS_CLOSE:
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_CLOSE), MOManufactureStatus.MOSTATUS_CLOSE));
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_PENDING), MOManufactureStatus.MOSTATUS_PENDING));
                SetInputEnable(false, MOManufactureStatus.MOSTATUS_CLOSE);
                break;

            case MOManufactureStatus.MOSTATUS_PENDING:
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_OPEN), MOManufactureStatus.MOSTATUS_OPEN));
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(MOManufactureStatus.MOSTATUS_PENDING), MOManufactureStatus.MOSTATUS_PENDING));
                SetInputEnable(true, MOManufactureStatus.MOSTATUS_PENDING);
                //SetPeddingInputEnable();
                break;
            }


            this.drpMOTypeEdit.Items.Clear();
            SystemParameterListBuilder _builder = new SystemParameterListBuilder("MOTYPE", base.DataProvider);
            _builder.Build(this.drpMOTypeEdit);
            _builder.AddAllItem(languageComponent1);

            this.drpMOStatusEdit.Items.Clear();
            this.drpMOStatusEdit.Items.Add(string.Empty);
            string[] moStatuses = GetMoStatuses();
            foreach (string item in moStatuses)
            {
                this.drpMOStatusEdit.Items.Add(new ListItem(this.languageComponent1.GetString(item.Trim()), item));
            }

            this.drpRouteEdit.Items.Clear();
            this.drpRouteEdit.Items.Add(new ListItem("", ""));
            object[] objs = this._facade.QueryNormalRouteByMOEnabled(this.GetMOCode(), string.Empty);
            if (objs != null)
            {
                foreach (Route route in objs)
                {
                    this.drpRouteEdit.Items.Add(route.RouteCode);
                }
            }

            #endregion

            this.SetEditObject(mo);
        }