Exemple #1
0
        protected override object GetEditObject()
        {
            //this.ValidateInput();
            if (_facade == null)
            {
                _facade = new SystemSettingFacade(base.DataProvider);
            }
            BenQGuru.eMES.Domain.BaseSetting.Parameter parameter = this._facade.CreateNewParameter();

            parameter.ParameterCode        = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtParameterCodeEdit.Text, 40));
            parameter.ParameterDescription = FormatHelper.CleanString(this.txtParameterDescriptionEdit.Text, 40);
            parameter.IsActive             = FormatHelper.BooleanToString(this.chbIsActiveEdit.Checked);
            parameter.IsSystem             = FormatHelper.BooleanToString(this.chbIsSystemEdit.Checked);
            parameter.ParameterGroupCode   = this.drpParameterGroupCodeEdit.SelectedValue;
            parameter.ParameterSequence    = FormatHelper.CleanString(this.txtParameterSeq.Text, 40);                   //参数顺序
            if (this.drpParameterGroupCodeEdit.SelectedValue == "")
            {
                parameter.ParameterValue = txtParameterCodeEdit.Text.Trim();
            }
            else
            {
                parameter.ParameterValue = this.drpParamterValueEdit.SelectedValue;
            }

            parameter.ParameterAlias      = FormatHelper.CleanString(this.txtParameterAliasEdit.Text, 40);
            parameter.MaintainUser        = this.GetUserCode();
            parameter.ParentParameterCode = this.drpParentParameter.SelectedValue;

            return(parameter);
        }
Exemple #2
0
        protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj)
        {
            BenQGuru.eMES.Domain.BaseSetting.Parameter parameter = new BenQGuru.eMES.Domain.BaseSetting.Parameter();
            parameter.ParameterCode = ((FactoryWeekCheck)obj).FactoryID.ToString();

            return(new Infragistics.WebUI.UltraWebGrid.UltraGridRow(
                       new object[] { "false",
                                      ((FactoryWeekCheck)obj).CheckID.ToString(),
                                      ((FactoryWeekCheck)obj).FactoryID.ToString(),
                                      ((FactoryWeekCheck)obj).WeekNo.ToString(),
                                      ((FactoryWeekCheck)obj).Total.ToString(),
                                      (((FactoryWeekCheck)obj).LRR / 100).ToString("##.##%") == "%" ? "0%" : (((FactoryWeekCheck)obj).LRR / 100).ToString("##.##%"),
                                      "" }));
        }
        private string GetFormular(string compareType)
        {
            string returnValue = string.Empty;

            SystemSettingFacade systemSettingFacade = new SystemSettingFacade(this.DataProvider);

            BenQGuru.eMES.Domain.BaseSetting.Parameter aCoefficient = (BenQGuru.eMES.Domain.BaseSetting.Parameter)systemSettingFacade.GetParameter("ACOEFFICIENT", "OQCQUALITYLEVELSETTING");
            BenQGuru.eMES.Domain.BaseSetting.Parameter bCoefficient = (BenQGuru.eMES.Domain.BaseSetting.Parameter)systemSettingFacade.GetParameter("BCOEFFICIENT", "OQCQUALITYLEVELSETTING");
            BenQGuru.eMES.Domain.BaseSetting.Parameter cCoefficient = (BenQGuru.eMES.Domain.BaseSetting.Parameter)systemSettingFacade.GetParameter("CCOEFFICIENT", "OQCQUALITYLEVELSETTING");
            BenQGuru.eMES.Domain.BaseSetting.Parameter zCoefficient = (BenQGuru.eMES.Domain.BaseSetting.Parameter)systemSettingFacade.GetParameter("ZCOEFFICIENT", "OQCQUALITYLEVELSETTING");

            double a = 0;
            double b = 0;
            double c = 0;
            double z = 0;

            if (aCoefficient != null)
            {
                double.TryParse(aCoefficient.ParameterAlias, out a);
            }
            if (bCoefficient != null)
            {
                double.TryParse(bCoefficient.ParameterAlias, out b);
            }
            if (cCoefficient != null)
            {
                double.TryParse(cCoefficient.ParameterAlias, out c);
            }
            if (zCoefficient != null)
            {
                double.TryParse(zCoefficient.ParameterAlias, out z);
            }

            returnValue = "SUM(**.zgradetimes*" + z.ToString("0.00") + "+agradetimes*" + a.ToString("0.00") +
                          "+bggradetimes*" + b.ToString("0.00") + "+cgradetimes*" + c.ToString("0.00") + ") AS oqcqualitylevelvalue";

            //EATTRIBUTE1用于标记投入/产出+比较类型
            if (compareType.Trim().Length > 0)
            {
                if (returnValue.Trim().Length > 0)
                {
                    returnValue += ",";
                }
                returnValue += "'" + compareType.Trim() + "'" + " AS EATTRIBUTE1 ";
            }
            return(returnValue);
        }