コード例 #1
0
        public zAppDev.DotNet.Framework.Identity.Model.ApplicationOperation Convert()
        {
            var model = new zAppDev.DotNet.Framework.Identity.Model.ApplicationOperation();

            if (_key != null && _key.ToString() != "0")
            {
                var rawKey    = _key.ToString();
                var parsedKey = int.Parse(rawKey);
                model = new DAL.Repository().GetById <zAppDev.DotNet.Framework.Identity.Model.ApplicationOperation>(parsedKey, false) ?? model;
            }
            if (!DTOHelper.SeenModelInstances.ContainsKey(this))
            {
                DTOHelper.SeenModelInstances.Add(this, model);
            }
            model.Id   = Id ?? 0;
            model.Name = Name;
            model.ParentControllerName = ParentControllerName;
            model.Type = Type;
            model.IsAvailableToAnonymous          = IsAvailableToAnonymous;
            model.IsAvailableToAllAuthorizedUsers = IsAvailableToAllAuthorizedUsers;
            DTOHelper.UpdateSeenModelInstances(this, model);
            return(model);
        }
コード例 #2
0
        public DSS5_SupplyChainFinancialsOptimisation.BO.Transaction Convert()
        {
            var model = new DSS5_SupplyChainFinancialsOptimisation.BO.Transaction();

            if (_key != null && _key.ToString() != "0")
            {
                var rawKey    = _key.ToString();
                var parsedKey = int.Parse(rawKey);
                model = new DAL.Repository().GetById <DSS5_SupplyChainFinancialsOptimisation.BO.Transaction>(parsedKey, false) ?? model;
            }
            if (!DTOHelper.SeenModelInstances.ContainsKey(this))
            {
                DTOHelper.SeenModelInstances.Add(this, model);
            }
            model.Id       = Id ?? 0;
            model.Supplier = Supplier == null
                             ? null
                             : DTOHelper.GetModelFromDTO <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(Supplier);
            model.ImportedBuyer = ImportedBuyer == null
                                  ? null
                                  : DTOHelper.GetModelFromDTO <DSS5_SupplyChainFinancialsOptimisation.BO.ImportedBuyer>(ImportedBuyer);
            DTOHelper.UpdateSeenModelInstances(this, model);
            return(model);
        }
        public DSS5_SupplyChainFinancialsOptimisation.BO.SupplierStatistic Convert()
        {
            var model = new DSS5_SupplyChainFinancialsOptimisation.BO.SupplierStatistic();

            if (_key != null && _key.ToString() != "0")
            {
                var rawKey    = _key.ToString();
                var parsedKey = int.Parse(rawKey);
                model = new DAL.Repository().GetById <DSS5_SupplyChainFinancialsOptimisation.BO.SupplierStatistic>(parsedKey, false) ?? model;
            }
            if (!DTOHelper.SeenModelInstances.ContainsKey(this))
            {
                DTOHelper.SeenModelInstances.Add(this, model);
            }
            model.Id       = Id ?? 0;
            model.Supplier = Supplier == null
                             ? null
                             : DTOHelper.GetModelFromDTO <DSS5_SupplyChainFinancialsOptimisation.BO.Supplier>(Supplier);
            model.CurrentTurnover  = CurrentTurnover;
            model.NextTurnover     = NextTurnover;
            model.PreviousTurnover = PreviousTurnover;
            DTOHelper.UpdateSeenModelInstances(this, model);
            return(model);
        }