Esempio n. 1
0
        internal static MaintenancePlan DataRowToPlan(DataRow dataRow)
        {
            if (dataRow == null)
            {
                throw new ArgumentNullException(nameof(dataRow));
            }
            int             int32           = Convert.ToInt32(dataRow["ID"]);
            string          str1            = MaintenanceModePlanDAL.GetValue <string>(dataRow, "AccountID", new Func <object, string>(Convert.ToString), (string)null);
            string          str2            = MaintenanceModePlanDAL.GetValue <string>(dataRow, "Name", new Func <object, string>(Convert.ToString), (string)null);
            string          str3            = MaintenanceModePlanDAL.GetValue <string>(dataRow, "Reason", new Func <object, string>(Convert.ToString), (string)null);
            bool            flag1           = MaintenanceModePlanDAL.GetValue <bool>(dataRow, "KeepPolling", new Func <object, bool>(Convert.ToBoolean), false);
            bool            flag2           = MaintenanceModePlanDAL.GetValue <bool>(dataRow, "Favorite", new Func <object, bool>(Convert.ToBoolean), false);
            bool            flag3           = MaintenanceModePlanDAL.GetValue <bool>(dataRow, "Enabled", new Func <object, bool>(Convert.ToBoolean), false);
            DateTime        dateTime1       = MaintenanceModePlanDAL.GetValue <DateTime>(dataRow, "UnmanageDate", new Func <object, DateTime>(Convert.ToDateTime), DateTime.MinValue);
            DateTime        dateTime2       = MaintenanceModePlanDAL.GetValue <DateTime>(dataRow, "RemanageDate", new Func <object, DateTime>(Convert.ToDateTime), DateTime.MinValue);
            MaintenancePlan maintenancePlan = new MaintenancePlan();

            maintenancePlan.set_AccountID(str1);
            maintenancePlan.set_Enabled(flag3);
            maintenancePlan.set_Favorite(flag2);
            maintenancePlan.set_ID(int32);
            maintenancePlan.set_KeepPolling(flag1);
            maintenancePlan.set_Name(str2);
            maintenancePlan.set_Reason(str3);
            maintenancePlan.set_RemanageDate(dateTime2);
            maintenancePlan.set_UnmanageDate(dateTime1);
            return(maintenancePlan);
        }
        // Token: 0x06000677 RID: 1655 RVA: 0x000269C4 File Offset: 0x00024BC4
        internal static MaintenancePlan DataRowToPlan(DataRow dataRow)
        {
            if (dataRow == null)
            {
                throw new ArgumentNullException("dataRow");
            }
            int      id     = Convert.ToInt32(dataRow["ID"]);
            string   value  = MaintenanceModePlanDAL.GetValue <string>(dataRow, "AccountID", new Func <object, string>(Convert.ToString), null);
            string   value2 = MaintenanceModePlanDAL.GetValue <string>(dataRow, "Name", new Func <object, string>(Convert.ToString), null);
            string   value3 = MaintenanceModePlanDAL.GetValue <string>(dataRow, "Reason", new Func <object, string>(Convert.ToString), null);
            bool     value4 = MaintenanceModePlanDAL.GetValue <bool>(dataRow, "KeepPolling", new Func <object, bool>(Convert.ToBoolean), false);
            bool     value5 = MaintenanceModePlanDAL.GetValue <bool>(dataRow, "Favorite", new Func <object, bool>(Convert.ToBoolean), false);
            bool     value6 = MaintenanceModePlanDAL.GetValue <bool>(dataRow, "Enabled", new Func <object, bool>(Convert.ToBoolean), false);
            DateTime value7 = MaintenanceModePlanDAL.GetValue <DateTime>(dataRow, "UnmanageDate", new Func <object, DateTime>(Convert.ToDateTime), DateTime.MinValue);
            DateTime value8 = MaintenanceModePlanDAL.GetValue <DateTime>(dataRow, "RemanageDate", new Func <object, DateTime>(Convert.ToDateTime), DateTime.MinValue);

            return(new MaintenancePlan
            {
                AccountID = value,
                Enabled = value6,
                Favorite = value5,
                ID = id,
                KeepPolling = value4,
                Name = value2,
                Reason = value3,
                RemanageDate = value8,
                UnmanageDate = value7
            });
        }
Esempio n. 3
0
 public string Create(MaintenancePlan plan)
 {
     using (IInformationServiceProxy2 iinformationServiceProxy2 = this.SwisFactory.Create())
     {
         Dictionary <string, object> dictionary = MaintenanceModePlanDAL.RemoveKeysFromDictionary(ObjectExtensions.ToDictionary <MaintenancePlan>((M0)plan), "ID");
         return(((IInformationServiceProxy)iinformationServiceProxy2).Create("Orion.MaintenancePlan", (IDictionary <string, object>)dictionary));
     }
 }
Esempio n. 4
0
 public void Update(string entityUri, MaintenancePlan plan)
 {
     using (IInformationServiceProxy2 iinformationServiceProxy2 = this.SwisFactory.Create())
     {
         Dictionary <string, object> dictionary = MaintenanceModePlanDAL.RemoveKeysFromDictionary(ObjectExtensions.ToDictionary <MaintenancePlan>((M0)plan), "ID");
         ((IInformationServiceProxy)iinformationServiceProxy2).Update(entityUri, (IDictionary <string, object>)dictionary);
     }
 }
 // Token: 0x0600067B RID: 1659 RVA: 0x00026B94 File Offset: 0x00024D94
 public void Update(string entityUri, MaintenancePlan plan)
 {
     using (IInformationServiceProxy2 informationServiceProxy = this.SwisFactory.Create())
     {
         Dictionary <string, object> dictionary = MaintenanceModePlanDAL.RemoveKeysFromDictionary(plan.ToDictionary <MaintenancePlan>(), new string[]
         {
             "ID"
         });
         informationServiceProxy.Update(entityUri, dictionary);
     }
 }
        // Token: 0x0600067A RID: 1658 RVA: 0x00026B34 File Offset: 0x00024D34
        public string Create(MaintenancePlan plan)
        {
            string result;

            using (IInformationServiceProxy2 informationServiceProxy = this.SwisFactory.Create())
            {
                Dictionary <string, object> dictionary = MaintenanceModePlanDAL.RemoveKeysFromDictionary(plan.ToDictionary <MaintenancePlan>(), new string[]
                {
                    "ID"
                });
                result = informationServiceProxy.Create("Orion.MaintenancePlan", dictionary);
            }
            return(result);
        }
 // Token: 0x0600067D RID: 1661 RVA: 0x00026C6C File Offset: 0x00024E6C
 public MaintenancePlan Get(int planID)
 {
     using (IInformationServiceProxy2 informationServiceProxy = this.SwisFactory.Create())
     {
         DataTable dataTable = informationServiceProxy.Query("\r\n                SELECT TOP 1 ID, AccountID, Name, Reason, KeepPolling, Favorite, Enabled, UnmanageDate, RemanageDate\r\n                FROM Orion.MaintenancePlan\r\n                WHERE ID = @PlanID", new Dictionary <string, object>
         {
             {
                 "PlanID",
                 planID
             }
         });
         if (dataTable != null && dataTable.Rows.Count == 1)
         {
             return(MaintenanceModePlanDAL.DataRowToPlan(dataTable.Rows.Cast <DataRow>().FirstOrDefault <DataRow>()));
         }
     }
     return(null);
 }
Esempio n. 8
0
 public MaintenancePlan Get(string entityUri)
 {
     using (IInformationServiceProxy2 iinformationServiceProxy2 = this.SwisFactory.Create())
     {
         DataTable dataTable = ((IInformationServiceProxy)iinformationServiceProxy2).Query("\r\n                SELECT TOP 1 ID, AccountID, Name, Reason, KeepPolling, Favorite, Enabled, UnmanageDate, RemanageDate\r\n                FROM Orion.MaintenancePlan\r\n                WHERE Uri = @EntityUri", (IDictionary <string, object>) new Dictionary <string, object>()
         {
             {
                 "EntityUri",
                 (object)entityUri
             }
         });
         if (dataTable != null)
         {
             if (dataTable.Rows.Count == 1)
             {
                 return(MaintenanceModePlanDAL.DataRowToPlan(dataTable.Rows.Cast <DataRow>().FirstOrDefault <DataRow>()));
             }
         }
     }
     return((MaintenancePlan)null);
 }