Exemple #1
0
        protected override Infragistics.WebUI.UltraWebGrid.UltraGridRow GetGridRow(object obj)
        {
            BenQGuru.eMES.Domain.Alert.Alert alert = obj as BenQGuru.eMES.Domain.Alert.Alert;
            if (alert != null)
            {
                Infragistics.WebUI.UltraWebGrid.UltraGridRow ur = new Infragistics.WebUI.UltraWebGrid.UltraGridRow(
                    new object[] { "false",
                                   alert.AlertID,
                                   alert.AlertMsg,
                                   alert.SSCode,
                                   alert.ProductCode,
                                   _alertConst.GetName(alert.AlertStatus),
                                   _alertConst.GetName(alert.AlertType),
                                   _alertConst.GetName(alert.AlertItem),
                                   "",
                                   alert.SendUser,
                                   FormatHelper.ToDateString(alert.AlertDate),
                                   FormatHelper.ToTimeString(alert.AlertTime),
                                   alert.MaintainUser,
                                   FormatHelper.ToDateString(alert.MaintainDate),
                                   FormatHelper.ToTimeString(alert.MaintainTime) });
                ur.Cells[2].Style.ForeColor = ColorHelper.GetColor(alert.AlertLevel);
                ur.Cells[5].Style.ForeColor = ColorHelper.GetColor(alert.AlertStatus);
                return(ur);
            }

            else
            {
                return(null);
            }
        }
        protected override void DeleteDomainObjects(ArrayList domainObjects)
        {
            this._alertFacade.DeleteAlertAndRelation(domainObjects);
            try
            {
                this.DataProvider.BeginTransaction();

                for (int i = 0; i < domainObjects.Count; i++)
                {
                    BenQGuru.eMES.Domain.Alert.Alert alert = domainObjects[i] as BenQGuru.eMES.Domain.Alert.Alert;
                    if (alert != null)
                    {
                    }

                    _alertFacade.DeleteAlert(alert);
                }

                DataProvider.CommitTransaction();
            }
            catch (System.Exception ex)
            {
                this.DataProvider.RollbackTransaction();
                throw ex;
            }
        }
Exemple #3
0
 protected override string[] FormatExportRecord(object obj)
 {
     if (this.chbExpDetails.Checked)            //导出处理记录
     {
         BenQGuru.eMES.Domain.Alert.Alert2Handle alert = obj as BenQGuru.eMES.Domain.Alert.Alert2Handle;
         if (alert != null)
         {
             return(new string[] {
                 alert.AlertMsg,
                 _alertConst.GetName(alert.HandlAlertStatus),
                 _alertConst.GetName(alert.AlertType),
                 _alertConst.GetName(alert.AlertItem),
                 alert.SendUser,
                 FormatHelper.ToDateString(alert.AlertDate),
                 FormatHelper.ToTimeString(alert.AlertTime),
                 alert.MaintainUser,
                 FormatHelper.ToDateString(alert.MaintainDate),
                 FormatHelper.ToTimeString(alert.MaintainTime),
                 alert.HandleMsg, alert.HandleUser, alert.UserEmail,
                 _alertConst.GetName(alert.AlertLevel),
                 FormatHelper.ToDateString(alert.HandleDate),
                 FormatHelper.ToTimeString(alert.HandleTime)
             });
         }
         else
         {
             return(null);
         }
     }
     else
     {
         BenQGuru.eMES.Domain.Alert.Alert alert = obj as BenQGuru.eMES.Domain.Alert.Alert;
         if (alert != null)
         {
             return(new string[] {
                 alert.AlertMsg,
                 _alertConst.GetName(alert.AlertStatus),
                 _alertConst.GetName(alert.AlertType),
                 _alertConst.GetName(alert.AlertItem),
                 alert.SendUser,
                 FormatHelper.ToDateString(alert.AlertDate),
                 FormatHelper.ToTimeString(alert.AlertTime),
                 alert.MaintainUser,
                 FormatHelper.ToDateString(alert.MaintainDate),
                 FormatHelper.ToTimeString(alert.MaintainTime)
             });
         }
         else
         {
             return(null);
         }
     }
 }
 protected override string[] FormatExportRecord(object obj)
 {
     BenQGuru.eMES.Domain.Alert.Alert alert = obj as BenQGuru.eMES.Domain.Alert.Alert;
     if (alert != null)
     {
         return(new string[] {
             _alertConst.GetName(alert.AlertLevel),
             alert.AlertMsg,
             _alertConst.GetName(alert.AlertStatus),
             alert.MailNotify == "Y"?"是":"否",
             alert.SendUser,
             FormatHelper.ToDateString(alert.AlertDate),
             FormatHelper.ToTimeString(alert.AlertTime),
             alert.MaintainUser
         });
     }
     else
     {
         return(null);
     }
 }
 protected override object GetEditObject(UltraGridRow row)
 {
     BenQGuru.eMES.Domain.Alert.Alert alert = new BenQGuru.eMES.Domain.Alert.Alert();
     alert.AlertID = int.Parse(row.Cells[1].Value.ToString());
     return(alert);
 }