Example #1
0
        public static ProofOfDeliveryDataSet_ApplicationUserDTO GetInstance(object key, string jbID)
        {
            if (key == null)
            {
                return(null);
            }
            var rawKey     = key.ToString();
            var parsedKey  = (rawKey);
            var foundEntry = new DAL.Repository().GetById <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>(parsedKey, false);

            if (foundEntry == null && !string.IsNullOrWhiteSpace(jbID))
            {
                if (int.TryParse(rawKey, out int _uniqueKey))
                {
                    var controller = new AdminProofOfDeliveryListController();
                    var method     = controller.GetType().GetMethod($"Get_{jbID}_DatasourceQueryable");
                    var records    = method.Invoke(controller, new object[] { null }) as IQueryable <zAppDev.DotNet.Framework.Identity.Model.ApplicationUser>;
                    foundEntry = records.Where(c => c._GetUniqueIdentifier() == _uniqueKey).FirstOrDefault();
                }
            }
            if (foundEntry != null)
            {
                return(new ProofOfDeliveryDataSet_ApplicationUserDTO(foundEntry));
            }
            return(null);
        }
Example #2
0
        public static ProofOfDeliveryDataSet_TransactionDTO 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 <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>(parsedKey, false);

            if (foundEntry == null && !string.IsNullOrWhiteSpace(jbID))
            {
                if (int.TryParse(rawKey, out int _uniqueKey))
                {
                    var controller = new AdminProofOfDeliveryListController();
                    var method     = controller.GetType().GetMethod($"Get_{jbID}_DatasourceQueryable");
                    var records    = method.Invoke(controller, new object[] { null }) as IQueryable <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>;
                    foundEntry = records.Where(c => c._GetUniqueIdentifier() == _uniqueKey).FirstOrDefault();
                }
            }
            if (foundEntry != null)
            {
                return(new ProofOfDeliveryDataSet_TransactionDTO(foundEntry));
            }
            return(null);
        }