Ejemplo n.º 1
0
        ///<summary>Gets one OrthoPlanLink by OrthoCaseNum and OrthoPlanLinkType. Each OrthoCase should have no more than one of each
        ///OrthoPlanLinkType associated to it.</summary>
        public static OrthoPlanLink GetOneForOrthoCaseByType(long orthoCaseNum, OrthoPlanLinkType linkType)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <OrthoPlanLink>(MethodBase.GetCurrentMethod(), orthoCaseNum, linkType));
            }
            string command = $@"SELECT * FROM orthoplanlink WHERE orthoplanlink.OrthoCaseNum={POut.Long(orthoCaseNum)}
				AND orthoplanlink.LinkType={POut.Int((int)linkType)}"                ;

            return(Crud.OrthoPlanLinkCrud.SelectOne(command));
        }
Ejemplo n.º 2
0
        ///<summary>Gets a list of all OrthoPlanLinks by OrthoPlanLinkType for a list of OrthoCaseNums.</summary>
        public static List <OrthoPlanLink> GetAllForOrthoCasesByType(List <long> listOrthoCaseNums, OrthoPlanLinkType linkType)
        {
            if (RemotingClient.RemotingRole == RemotingRole.ClientWeb)
            {
                return(Meth.GetObject <List <OrthoPlanLink> >(MethodBase.GetCurrentMethod(), listOrthoCaseNums, linkType));
            }
            if (listOrthoCaseNums.Count <= 0)
            {
                return(new List <OrthoPlanLink>());
            }
            string command = $@"SELECT * FROM orthoplanlink WHERE orthoplanlink.LinkType={POut.Int((int)linkType)}
				AND orthoplanlink.OrthoCaseNum IN({string.Join(",",listOrthoCaseNums)})"                ;

            return(Crud.OrthoPlanLinkCrud.SelectMany(command));
        }