public Log(ServiceHistoryView selectedService)
 {
     InitializeComponent();
     BindingData = new LogBindingData();
     BindingData.ServiceHistoryView = selectedService;
     BindingData.GetLogMessage();
     this.DataContext = Log.BindingData;
 }
        private void _btnLog_Click(object sender, RoutedEventArgs e)
        {
            Button btnLog = (Button)sender;

            ServiceHistoryView shv = (ServiceHistoryView)btnLog.DataContext;
            Log l = new Log(shv);

            l.Show();
        }
        private void _btnLog_Click(object sender, RoutedEventArgs e)
        {
            Button btnLog = (Button)sender;

            InstanceView       iv  = (InstanceView)btnLog.DataContext;
            ServiceHistoryView shv = new ServiceHistoryView()
            {
                AccountID   = iv.AccountID,
                ServiceName = iv.ServiceName,
                InstanceID  = int.Parse(iv.InstanceID),
                Outcome     = iv.Outcome
            };
            Log l = new Log(shv);

            l.Show();
        }
示例#4
0
        public static Result GetServiceHistory(string chiTietChiDinhGUID)
        {
            Result     result = new Result();
            MMOverride db     = null;

            try
            {
                db = new MMOverride();
                ServiceHistoryView srvHistory = (from d in db.DichVuChiDinhs
                                                 join s in db.ServiceHistoryViews on d.ServiceHistoryGUID equals s.ServiceHistoryGUID
                                                 where d.ChiTietChiDinhGUID.ToString() == chiTietChiDinhGUID
                                                 select s).FirstOrDefault();

                result.QueryResult = srvHistory;
            }
            catch (System.Data.SqlClient.SqlException se)
            {
                result.Error.Code        = (se.Message.IndexOf("Timeout expired") >= 0) ? ErrorCode.SQL_QUERY_TIMEOUT : ErrorCode.INVALID_SQL_STATEMENT;
                result.Error.Description = se.ToString();
            }
            catch (Exception e)
            {
                result.Error.Code        = ErrorCode.UNKNOWN_ERROR;
                result.Error.Description = e.ToString();
            }
            finally
            {
                if (db != null)
                {
                    db.Dispose();
                    db = null;
                }
            }

            return(result);
        }