Exemple #1
0
        public override DataSet Clone()
        {
            SpecialAgentDS cln = ((SpecialAgentDS)(base.Clone()));

            cln.InitVars();
            return(cln);
        }
Exemple #2
0
        public DataSet ToDataSet()
        {
            //Return a dataset containing values for this object
            SpecialAgentDS ds = null;

            try {
                ds = new SpecialAgentDS();
                SpecialAgentDS.SpecialAgentTableRow specialagent = ds.SpecialAgentTable.NewSpecialAgentTableRow();
                specialagent.ID              = this._id;
                specialagent.CLIENT_NUMBER   = this._client_number;
                specialagent.CLIENT_DIVISION = this._client_division;
                specialagent.LOCATION        = this._location;
                if (this._account_number.Length > 0)
                {
                    specialagent.ACCOUNT_NUMBER = this._account_number;
                }
                if (this._san_id.Length > 0)
                {
                    specialagent.SAN_ID = this._san_id;
                }
                if (this._zone_code.Length > 0)
                {
                    specialagent.ZONE_CODE = this._zone_code;
                }
                if (this._is_record.Length > 0)
                {
                    specialagent.IS_RECORD = this._is_record;
                }
                if (this._title.Length > 0)
                {
                    specialagent.TITLE = this._title;
                }
                if (this._instructions.Length > 0)
                {
                    specialagent.INSTRUCTIONS = this._instructions;
                }
                if (this._indicator.Length > 0)
                {
                    specialagent.INDICATOR = this._indicator;
                }
                if (this._icon.Length > 0)
                {
                    specialagent.ICON = this._icon;
                }
                ds.SpecialAgentTable.AddSpecialAgentTableRow(specialagent);
            }
            catch (Exception) { }
            return(ds);
        }
Exemple #3
0
 public static void RefreshCache()
 {
     //Refresh cached data
     try {
         //Get special agents from data store and cache results
         DataSet ds = Mediator.FillDataset(USP_SPECIALAGENT_DETAIL, TBL_SPECIALAGENT_DETAIL, null);
         if (ds == null)
         {
             throw new ApplicationException("Failed to cache special agents.");
         }
         else
         {
             //Cache special agents
             SpecialAgentsCached       = new Hashtable();
             SpecialAgentsByZoneCached = new Hashtable();
             SpecialAgentDS specialAgentDS = new SpecialAgentDS();
             specialAgentDS.Merge(ds);
             for (int i = 0; i < specialAgentDS.SpecialAgentTable.Rows.Count; i++)
             {
                 SpecialAgent agent = null;
                 if (specialAgentDS.SpecialAgentTable[i].ID == "0000")
                 {
                     agent = SpecialAgentDefault = new SpecialAgent(specialAgentDS.SpecialAgentTable[i]);
                 }
                 else if (specialAgentDS.SpecialAgentTable[i].ID == "0001")
                 {
                     agent = new StatSampleSpecialAgent(specialAgentDS.SpecialAgentTable[i]);
                 }
                 else if (specialAgentDS.SpecialAgentTable[i].ID.Substring(0, 2) == "04")
                 {
                     agent = new UPSSpecialAgent(specialAgentDS.SpecialAgentTable[i]);
                 }
                 else
                 {
                     agent = new SpecialAgent(specialAgentDS.SpecialAgentTable[i]);
                 }
                 SpecialAgentsCached.Add(agent.CLIENT_NUMBER.Trim() + agent.CLIENT_DIVISION.Trim() + agent.SAN_ID.Trim(), agent);
                 SpecialAgentsByZoneCached.Add(agent.CLIENT_NUMBER.Trim() + agent.CLIENT_DIVISION.Trim() + agent.ZONE_CODE.Trim(), agent);
             }
         }
     }
     catch (ApplicationException ex) { throw ex; }
     catch (Exception ex) { throw new ApplicationException("Unexpected error while caching SortFactory data.", ex); }
 }