public XmlDocument GetAuthorizationInfo(string siteCode, bool statusApproved)
        {
            XmlDocument doc = new XmlDocument();

            if (statusApproved == false)
            {
                RequestManagementList rmList        = new RequestManagementList();
                HydroSecurityInternal hydroInternal = new HydroSecurityInternal();
                rmList = hydroInternal.GetPendingAuthorizationInfo(siteCode);
                XmlSerializer             ser    = new XmlSerializer(rmList.GetType());
                System.Text.StringBuilder sb     = new StringBuilder();
                System.IO.StringWriter    writer = new StringWriter(sb);
                ser.Serialize(writer, rmList);
                doc.LoadXml(sb.ToString());
            }
            else
            {
                AuthorizationList     authList      = new AuthorizationList();
                HydroSecurityInternal hydroInternal = new HydroSecurityInternal();
                authList = hydroInternal.GetApprovedAuthorizationInfo(siteCode);
                XmlSerializer             ser    = new XmlSerializer(authList.GetType());
                System.Text.StringBuilder sb     = new StringBuilder();
                System.IO.StringWriter    writer = new StringWriter(sb);
                ser.Serialize(writer, authList);
                doc.LoadXml(sb.ToString());
            }
            return(doc);
        }
        public void SetAccess(int userId, string resourceGuid, string accessLevel)
        {
            Guid g = new Guid(resourceGuid);
            HydroSecurityInternal hydroInternal = new HydroSecurityInternal();

            hydroInternal.SetAccess(userId, g, accessLevel);
        }
        public List <string> GetUserList()
        {
            List <string>         userEmailList = new List <string>();
            HydroSecurityInternal hydroInternal = new HydroSecurityInternal();

            userEmailList = hydroInternal.GetUserList();
            return(userEmailList);
        }
        public void RequestAuthorization(string operationType, string resourceType, string siteCode)
        {
            ResourcesList rs      = new ResourcesList();
            List <Guid>   rsGuids = new List <Guid>();

            rsGuids = rs.load(siteCode);
            HydroSecurityInternal HydroInternal = new HydroSecurityInternal();

            HydroInternal.QueueAuthorizationRequest(operationType, 2, rsGuids);
        }
        public XmlDocument GetResourceTypes()
        {
            XmlDocument           doc           = new XmlDocument();
            HydroSecurityInternal hydroInternal = new HydroSecurityInternal();
            ResourceTypeList      resTypeList   = new ResourceTypeList();

            resTypeList = hydroInternal.GetResourceTypes();
            XmlSerializer ser = new XmlSerializer(resTypeList.GetType());

            System.Text.StringBuilder sb     = new System.Text.StringBuilder();
            System.IO.StringWriter    writer = new System.IO.StringWriter(sb);
            ser.Serialize(writer, resTypeList);
            doc.LoadXml(sb.ToString());
            return(doc);
        }
        public XmlDocument GetUserInfo(List <string> userEmailAddList)
        {
            XmlDocument           doc           = new XmlDocument();
            ResourceConsumerList  rs            = new ResourceConsumerList();
            HydroSecurityInternal hydroInternal = new HydroSecurityInternal();

            rs = hydroInternal.ResolveUserInfo(userEmailAddList);
            XmlSerializer ser = new XmlSerializer(rs.GetType());

            System.Text.StringBuilder sb     = new System.Text.StringBuilder();
            System.IO.StringWriter    writer = new System.IO.StringWriter(sb);
            ser.Serialize(writer, rs);
            doc.LoadXml(sb.ToString());
            return(doc);
        }
        public TimeSeriesResourcesList GetResourceInfoById(string resId)
        {
            XmlDocument             doc           = new XmlDocument();
            TimeSeriesResourcesList tm            = new TimeSeriesResourcesList();
            HydroSecurityInternal   hydroInternal = new HydroSecurityInternal();
            Guid g = new Guid(resId);

            tm = hydroInternal.GetResourceByGuid(g);
            //XmlSerializer ser = new XmlSerializer(tm.GetType());
            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //System.IO.StringWriter writer = new System.IO.StringWriter(sb);
            //ser.Serialize(writer, tm);
            //doc.LoadXml(sb.ToString());
            //return doc;
            return(tm);
        }
        public ResourceCatalog GetResourceInfo(Parameters parameters, string resourceType)
        {
            XmlDocument             doc           = new XmlDocument();
            TimeSeriesResourcesList tm            = new TimeSeriesResourcesList();
            HydroSecurityInternal   hydroInternal = new HydroSecurityInternal();
            ResourceCatalog         resCat        = new ResourceCatalog();

            resCat = hydroInternal.ResolveResources(parameters, resourceType);
            //XmlSerializer ser = new XmlSerializer(resCat.GetType());
            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //System.IO.StringWriter writer = new System.IO.StringWriter(sb);
            //ser.Serialize(writer, resCat);
            //doc.LoadXml(sb.ToString());

            return(resCat);
        }
        public ResourceCatalog GetResourceInfoByDate(DateTime startDate, DateTime endDate)
        {
            XmlDocument           doc           = new XmlDocument();
            ResourceCatalog       resCat        = new ResourceCatalog();
            HydroSecurityInternal hydroInternal = new HydroSecurityInternal();

            resCat = hydroInternal.GetByDate(startDate, endDate);
            //XmlSerializer ser = new XmlSerializer(resCat.GetType());
            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //System.IO.StringWriter writer = new System.IO.StringWriter(sb);
            //ser.Serialize(writer, resCat);
            //doc.LoadXml(sb.ToString());
            //return doc;

            return(resCat);
        }