コード例 #1
0
        protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj)
        {
            Infragistics.WebUI.UltraWebGrid.UltraGridRow ur;
            if (isResourceNG)
            {
                BenQGuru.eMES.Domain.Alert.AlertResBill alert = obj as BenQGuru.eMES.Domain.Alert.AlertResBill;
                if (alert == null)
                {
                    return(null);
                }
                ur = new Infragistics.WebUI.UltraWebGrid.UltraGridRow(
                    new object[] { "false",
                                   alert.BillId.ToString(),
                                   alert.ItemCode,
                                   AlertMsg.GetAlertName(alert.AlertType, this.languageComponent1),
                                   AlertMsg.GetAlertName(alert.AlertItem, this.languageComponent1),
                                   alert.ResourceCode,
                                   alert.ErrorGroup2Code,
                                   alert.StartNum.ToString(),
                                   GetCondition(alert),
                                   FormatHelper.ToDateString(alert.ValidDate),
                                   alert.MailNotify == "Y"?"是":"否",
                                   "" });
            }
            else
            {
                BenQGuru.eMES.Domain.Alert.AlertBill alert = obj as BenQGuru.eMES.Domain.Alert.AlertBill;
                if (alert == null)
                {
                    return(null);
                }
                ur = new Infragistics.WebUI.UltraWebGrid.UltraGridRow(
                    new object[] { "false",
                                   alert.BillId.ToString(),
                                   alert.ItemCode,
                                   AlertMsg.GetAlertName(alert.AlertType, this.languageComponent1),
                                   AlertMsg.GetAlertName(alert.AlertItem, this.languageComponent1),
                                   alert.ProductCode,
                                   alert.StartNum.ToString(),
                                   GetCondition(alert),
                                   FormatHelper.ToDateString(alert.ValidDate),
                                   alert.MailNotify == "Y"?"是":"否",
                                   "" });
            }

            return(ur);
        }
コード例 #2
0
 protected override string[] FormatExportRecord(object obj)
 {
     BenQGuru.eMES.Domain.Alert.AlertBill alert = obj as BenQGuru.eMES.Domain.Alert.AlertBill;
     if (alert != null)
     {
         return(new string[] {
             alert.ItemCode,
             AlertMsg.GetAlertName(alert.AlertType, this.languageComponent1),
             alert.StartNum.ToString(),
             GetCondition(alert),
             FormatHelper.ToDateString(alert.ValidDate),
             alert.MailNotify == "Y"?"是":"否"
         });
     }
     else
     {
         return(null);
     }
 }
コード例 #3
0
 protected override void Grid_ClickCell(UltraGridCell cell)
 {
     base.Grid_ClickCell(cell);
     if (isResourceNG)
     {
         string billid    = cell.Row.Cells[1].Text.Trim();
         string itemcode  = cell.Row.Cells.FromKey("AlertItemValue").Text.Trim();
         string alerttype = AlertType_Old.ResourceNG;
         string alertitem = AlertMsg.GetAlertCode(cell.Row.Cells.FromKey("AlertItem").Text.Trim(), this.languageComponent1);
         string rescode   = (cell.Row.Cells.FromKey("AlertRes") != null) ? cell.Row.Cells.FromKey("AlertRes").Text.Trim() : string.Empty;
         string ecg2ec    = (cell.Row.Cells.FromKey("ECG2EC") != null) ? cell.Row.Cells.FromKey("ECG2EC").Text.Trim() : string.Empty;
         if (cell.Column.Key == "Notifier")
         {
             SaveQuery();
             Response.Redirect(this.MakeRedirectUrl("FNotifierQP.aspx", new string[] { "billid", "itemcode", "alerttype", "alertitem", "rescode", "ecg2ec" }, new string[] { billid, itemcode, alerttype, alertitem, rescode, ecg2ec }));
         }
         if (this.gridHelper.IsClickEditColumn(cell))
         {
             SaveQuery();
             Response.Redirect(this.MakeRedirectUrl("FAlertBillEP.aspx", new string[] { "billid", "itemcode", "alerttype", "alertitem", "rescode", "ecg2ec" }, new string[] { billid, itemcode, alerttype, alertitem, rescode, ecg2ec }));
         }
     }
     else
     {
         if (cell.Column.Key == "Notifier")
         {
             SaveQuery();
             Response.Redirect(this.MakeRedirectUrl("FNotifierQP.aspx", new string[] { "billid", "alerttype" }, new string[] { cell.Row.Cells[1].Text.Trim(), _alertConst.GetCode(cell.Row.Cells.FromKey("AlertType").Text.Trim()) }));
         }
         if (this.gridHelper.IsClickEditColumn(cell))
         {
             SaveQuery();
             Response.Redirect(this.MakeRedirectUrl("FAlertBillEP.aspx", new string[] { "billid", "alerttype" }, new string[] { cell.Row.Cells[1].Text.Trim(), _alertConst.GetCode(cell.Row.Cells.FromKey("AlertType").Text.Trim()) }));
         }
     }
 }
コード例 #4
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));
                        }
                    }
                }
                //}
            }
        }