public ReferenceDefinition(ReferenceTypeEnum referenceType, ReferenceEndpoint referenceFrom, ReferenceEndpoint referenceTo)
        {
            if (referenceFrom == null)
            {
                throw new ArgumentNullException("referenceFrom");
            }
            if (referenceTo == null)
            {
                throw new ArgumentNullException("referenceTo");
            }

            if (referenceFrom.ReferenceKind != ReferenceKind.ReferencesTo)
            {
                throw new ArgumentException("Incorrect reference kind for 'referenceFrom'");
            }
            if (referenceTo.ReferenceKind != ReferenceKind.ReferencedBy)
            {
                throw new ArgumentException("Incorrect reference kind for 'referenceTo'");
            }

            ReferenceType = referenceType;
            ReferenceFrom = referenceFrom;
            ReferenceTo   = referenceTo;

            ReferenceFrom.AddReference(this);
            ReferenceTo.AddReference(this);
        }
Exemplo n.º 2
0
        public async Task <IActionResult> References(ReferenceTypeEnum t)
        {
            ViewBag.ReferenceType = t;
            var model = await _sysAdminSvc.GetReferences(t);

            return(View(model));
        }
Exemplo n.º 3
0
        public MethodReference(ReferenceTypeEnum referenceType, ReferenceEndpoint referenceFrom, ReferenceEndpoint referenceTo, IMethodSymbol methodSymbol)
            : base(referenceType, referenceFrom, referenceTo)
        {
            if (methodSymbol == null)
            {
                throw new ArgumentNullException("methodSymbol");
            }

            MethodSymbol = methodSymbol;
        }
Exemplo n.º 4
0
        public async Task <Reference[]> GetReferences(ReferenceTypeEnum type)
        {
            var route = type == ReferenceTypeEnum.Specialty?
                        ROUTE_GET_SPECIALTIES: type == ReferenceTypeEnum.Duty?
                        ROUTE_GET_DUTIES: ROUTE_GET_QUALIFICATIONS;

            var result = await _apiConnector.HttpGet <PagedQuery <Reference> >(route);

            return(result.Records);
        }
Exemplo n.º 5
0
 public ReferenceList(ReferenceTypeEnum rte, string uri)
 {
     if (rte == ReferenceTypeEnum.DataReference)
     {
         DataReference     = new ReferenceType();
         DataReference.URI = uri;
     }
     else             //KeyRef
     {
         KeyReference     = new ReferenceType();
         KeyReference.URI = uri;
     }
 }
Exemplo n.º 6
0
        public static async Task <PagedQuery <Reference> > GetRerencesByType(
            DbConnector connector, ReferenceTypeEnum referenceType, bool?activeOnly)
        {
            var criteria = new Dictionary <string, object>();

            criteria.Add(nameof(Reference.ReferenceType), referenceType.ToString());
            if (activeOnly.HasValue && activeOnly.Value)
            {
                criteria.Add(nameof(Reference.ActiveStatus), activeOnly.Value);
            }

            return(await DbHelper.SearchEntities <Reference>(connector, criteria,
                                                             0, int.MaxValue, nameof(Reference.ReferenceCode), false));
        }
Exemplo n.º 7
0
        public IActionResult EditReference(ReferenceTypeEnum t)
        {
            if (t == ReferenceTypeEnum.Duty)
            {
                return(RedirectToAction(nameof(EditDuty)));
            }

            RefViewMode model = new RefViewMode
            {
                ActiveStatus = true,
                Type         = RefViewMode.Translate(t)
            };

            return(View(model));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Get OrderReference by Order Id and Type
        /// </summary>
        /// <param name="orderId">Order Id</param>
        /// <param name="referenceType">Reference Type</param>
        /// <returns>OrderReference model</returns>
        public OrderReference GetByOrderIdAndReferenceType(int orderId, ReferenceTypeEnum referenceType)
        {
            const string SQL_STATEMENT = @"
                SELECT  Id,
                        OrderId,
                        ReferenceTypeCode,
                        Reference,
                        UpdatedByUserId,
                        UpdatedDateTime
                FROM Booking.OrderReference
                WHERE OrderId = @OrderId AND ReferenceTypeCode = @ReferenceTypeCode";

            var parameters = new List<SqlParameter>
                                 {
                                     DbHelper.CreateParameter(OrderReferenceMapper.ORDERID, orderId),
                                     DbHelper.CreateParameter(OrderReferenceMapper.REFERENCETYPECODE, referenceType.GetCode())
                                 };

            return DbHelper.CreateInstance(SQL_STATEMENT, OrderReferenceMapper.MapReader, parameters: parameters);
        }
Exemplo n.º 9
0
		public ReferenceList(ReferenceTypeEnum rte, string uri)
		{
			if(rte == ReferenceTypeEnum.DataReference)
			{
				DataReference = new ReferenceType();
				DataReference.URI = uri;
			}
			else //KeyRef
			{
				KeyReference = new ReferenceType();
				KeyReference.URI = uri;
			}
		}
Exemplo n.º 10
0
 public static string Translate(ReferenceTypeEnum type) =>
 type == ReferenceTypeEnum.Specialty ? "专业" :
 type == ReferenceTypeEnum.Duty ? "职责" :
 type == ReferenceTypeEnum.Qualification ? "资格类型" :
 throw (new Exception("Error reference type"));