コード例 #1
0
 private string GetCondition(BenQGuru.eMES.Domain.Alert.AlertBill alert)
 {
     if (alert.Operator == Operator_Old.BW)
     {
         return(string.Format(_alertConst.GetName(Operator_Old.BW), NumberHelper.TrimZero(alert.LowValue), NumberHelper.TrimZero(alert.UpValue)));
     }
     else
     {
         return(_alertConst.GetName(alert.Operator) + NumberHelper.TrimZero(alert.LowValue));
     }
 }
コード例 #2
0
        private void LoadResData()
        {
            this.ExecuteClientFunction("setResDisplay", "");
            BenQGuru.eMES.Domain.Alert.AlertResBill alert = (BenQGuru.eMES.Domain.Alert.AlertResBill) this._alertBillFacade.GetAlertResBill(this._billId);
            if (alert != null)
            {
                this.ViewState["_itemcode"] = alert.ItemCode;
                _alerttype = alert.AlertType;
                this.ViewState["_alertitem"] = alert.AlertItem;
                this.ViewState["_rescode"]   = alert.ResourceCode;
                this.ViewState["._ecg2ec"]   = alert.ErrorGroup2Code;

                this.txtResource.Text  = this.ViewState["_rescode"].ToString();
                this.txtEcg2Ec.Text    = this.ViewState["._ecg2ec"].ToString();
                this.txtItemCode.Text  = alert.ItemCode;
                this.txtAlertItem.Text = AlertMsg.GetAlertName(alert.AlertItem, this.languageComponent1);
                this.txtAlertType.Text = AlertMsg.GetAlertName(alert.AlertType, this.languageComponent1);

                //不良资源只有大于等于才有效
                if (this._alerttype == AlertType_Old.ResourceNG)
                {
                    this.txtStartNum.Text = string.Empty;
                    this.drpOperator.Items.RemoveAt(0);
                    this.drpOperator.Items.RemoveAt(0);
                }
                else
                {
                    this.txtStartNum.Text = NumberHelper.TrimZero(alert.StartNum);
                }

                this.drpOperator.SelectedValue = alert.Operator;
                if (this.drpOperator.SelectedValue != Operator_Old.BW)
                {
                    this.lblAnd.Visible = false;
                    this.txtUp.Visible  = false;
                }
                this.txtLow.Text           = NumberHelper.TrimZero(alert.LowValue);
                this.txtUp.Text            = NumberHelper.TrimZero(alert.UpValue);
                this.dateValidDate.Text    = FormatHelper.ToDateString(alert.ValidDate);
                this.txtAlertMsg.Text      = alert.AlertMsg;
                this.txtDesc.Text          = alert.Description;
                this.chbMailNotify.Checked = (alert.MailNotify == "Y");
                //load 用户
                //if(this.chbMailNotify.Checked)
                //{
                object[] objs = _alertBillFacade.QueryAlertNotifier(_billId);
                if (objs != null)
                {
                    foreach (object obj in objs)
                    {
                        BenQGuru.eMES.Domain.Alert.AlertNotifier notifier = obj as BenQGuru.eMES.Domain.Alert.AlertNotifier;
                        if (notifier == null)
                        {
                            continue;
                        }

                        BenQGuru.eMES.Domain.BaseSetting.User user = _userfacade.GetUser(notifier.UserCode) as BenQGuru.eMES.Domain.BaseSetting.User;
                        if (user != null && user.UserEmail != null)
                        {
                            this.lstUser.Items.Add(new ListItem(user.UserCode + "(" + user.UserEmail + ")", user.UserCode));
                        }
                        else                         //没找到则是手动加入的用户
                        {
                            this.lstUser.Items.Add(new ListItem(notifier.UserCode + "(" + notifier.EMail + ")", notifier.UserCode));
                        }
                    }
                }
                //}
            }
        }