Example #1
0
        public static AppNotifications_AppNotificationDTO GetInstance(object key, string jbID)
        {
            if (key == null)
            {
                return(null);
            }
            var rawKey     = key.ToString();
            var parsedKey  = int.Parse(rawKey);
            var foundEntry = new DAL.Repository().GetById <DSS1_RetailerDriverStockOptimisation.BO.AppNotification>(parsedKey, false);

            if (foundEntry == null && !string.IsNullOrWhiteSpace(jbID))
            {
                if (int.TryParse(rawKey, out int _uniqueKey))
                {
                    var controller = new MasterPageController();
                    var method     = controller.GetType().GetMethod($"Get_{jbID}_DatasourceQueryable");
                    var records    = method.Invoke(controller, new object[] { null }) as IQueryable <DSS1_RetailerDriverStockOptimisation.BO.AppNotification>;
                    foundEntry = records.Where(c => c._GetUniqueIdentifier() == _uniqueKey).FirstOrDefault();
                }
            }
            if (foundEntry != null)
            {
                return(new AppNotifications_AppNotificationDTO(foundEntry));
            }
            return(null);
        }
Example #2
0
 void MasterDetailPageDisappearing(object sender, EventArgs e)
 {
     MasterPageController?.SendDisappearing();
     DetailPageController?.SendDisappearing();
 }