Beispiel #1
0
        public void Get(bool activeOperatorsOnly)
        {
            SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor();

            sp.ProcedureName = "net_operators_get";

            SqlDataReaderAccessor reader = sp.ExecuteReader();

            try
            {
                this.Clear();

                while (reader.Read())
                {
                    OperatorStatus operatorStatus = (OperatorStatus)reader.GetShort("operatorStatusID");
                    string         name           = reader.GetString("name");

                    if (!activeOperatorsOnly ||
                        OperatorStatus.New == operatorStatus ||
                        OperatorStatus.Normal == operatorStatus)
                    {
                        this.Add(
                            reader.GetGuidString("operatorKey"),
                            operatorStatus,
                            name,
                            reader.GetString("soapReplicationURL"));
                    }
                    else
                    {
                        Debug.Write(
                            SeverityType.Info,
                            CategoryType.Replication,
                            String.Format(
                                "Removing operator '{0}' with status '{1}' from list of replication operators",
                                name,
                                operatorStatus.ToString()));
                    }
                }
            }
            finally
            {
                reader.Close();
            }
        }
 public override string ToString()
 {
     return(string.Format("OperatorStatusChangeEventArgs OperaotrId={0} Status={1}", OperatorId, Status.ToString()));
 }