// JSON Helper Functions
 private string BuildJSONPersonIds(List<string> uris)
 {
     // we send out an object with the following structure
     //  {baseURI : "http://whatever", suffix : [123, 456]},
     //  {baseURI2 : "http://somethingElse", suffix : [789, 111]}
     Dictionary<string, List<string>> allPeople = new Dictionary<string, List<string>>();
     string baseURI = new DataIO().GetRESTBaseURI();
     allPeople.Add(baseURI, new List<string>());
     foreach (String uri in uris)
     {
         if (uri.StartsWith(baseURI))
         {
             allPeople[baseURI].Add(uri.Substring(baseURI.Length));
         }
         else
         {   // this should not happen in Profiles, but just in case...
             // don't bother with logic to find common baseURI's just now
             if (!allPeople.ContainsKey(""))
             {
                 allPeople.Add("", new List<string>());
             }
             allPeople[""].Add(uri);
         }
     }
     return Serialize(allPeople);
 }
    public void BeginProcessRequest(Site site)
    {
        string sql = "";
        int iResult = 0;
        this.Site = site;

        oDataIO = new DataIO();
        SqlConnection Conn = new SqlConnection();
        Conn = oDataIO.GetDBConnection("ProfilesDB");
        sqlCmd = new SqlCommand();
        sqlCmd.Connection = Conn;

        site.IsDone = false;
        _request = WebRequest.Create(site.URL);

        // Enter log record
        sql = "insert into FSLogOutgoing(FSID,SiteID,Details,SentDate,QueryString) "
             + " values ('" + site.FSID.ToString() + "'," + site.SiteID.ToString() + ",0,GetDate()," + cs(site.SearchPhrase) + ")";
        sqlCmd.CommandText = sql;
        sqlCmd.CommandType = System.Data.CommandType.Text;
        iResult = sqlCmd.ExecuteNonQuery();

        if (sqlCmd.Connection.State == System.Data.ConnectionState.Open)
            sqlCmd.Connection.Close();

        _request.BeginGetResponse(new AsyncCallback(EndProcessRequest), site);
    }
Example #3
0
 // UCSF
 public PublicationDate GetPubDate(string MPID, string PMID, string PubID)
 {
     DataIO data = new DataIO();
     String pd = "";
     if (PMID != null && PMID.Trim().Length > 0)
     {
         pd = data.ProcessDateSQL("select PubDate from [Profile.Data].[Publication.PubMed.General] where PMID = '" + PMID + "';");
     }
     else if (MPID != null && MPID.Trim().Length > 0)
     {
         pd = data.ProcessDateSQL("select publicationdt from [Profile.Data].[Publication.MyPub.General] where mpid = '" + MPID + "';");
     }
     else if (PubID != null && PubID.Trim().Length > 0)
     {
         pd = data.ProcessDateSQL("select isnull(m.publicationdt, p.PubDate) from [Profile.Data].[Publication.Person.Include] i left outer join [Profile.Data].[Publication.MyPub.General] m on i.mpid = m.mpid left outer join " +
                    "[Profile.Data].[Publication.PubMed.General] p on i.pmid = p.pmid where pubid = '" + PubID + "';");
     }
     return new PublicationDate { pubDate = pd };
 }
Example #4
0
    // UCSF
    public PublicationDate GetPubDate(string MPID, string PMID, string PubID)
    {
        DataIO data = new DataIO();
        String pd   = "";

        if (PMID != null && PMID.Trim().Length > 0)
        {
            pd = data.ProcessDateSQL("select PubDate from [Profile.Data].[Publication.PubMed.General] where PMID = '" + PMID + "';");
        }
        else if (MPID != null && MPID.Trim().Length > 0)
        {
            pd = data.ProcessDateSQL("select publicationdt from [Profile.Data].[Publication.MyPub.General] where mpid = '" + MPID + "';");
        }
        else if (PubID != null && PubID.Trim().Length > 0)
        {
            pd = data.ProcessDateSQL("select isnull(m.publicationdt, p.PubDate) from [Profile.Data].[Publication.Person.Include] i left outer join [Profile.Data].[Publication.MyPub.General] m on i.mpid = m.mpid left outer join " +
                                     "[Profile.Data].[Publication.PubMed.General] p on i.pmid = p.pmid where pubid = '" + PubID + "';");
        }
        return(new PublicationDate {
            pubDate = pd
        });
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();

        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = "";
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        if (Session["DB"] == null)
        {
            Response.Redirect("~/Default.aspx", true);
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName"].ToString();
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
        }
        pDataIO = null;
        pDataIO = new SqlManager(serverName, dbName, userId, pwd);

        Session["TreeNodeExpand"] = null;
        SetSessionBlockType(3);
        if (Request.QueryString["uId"] != null)
        {
            EquipID = Request.QueryString["uId"];
        }

        if (Request.QueryString["AddNew"] != null)
        {
            AddNew  = (Request.QueryString["AddNew"].ToLower() == "true" ? true : false);
            EquipID = "-1";
        }
        queryStr = "select * from GlobalAllEquipmentList where id =" + EquipID;
        initPageInfo();
    }
Example #6
0
        //增加图层
        void AddLayer()
        {
            if (mReadLayerDialog.ShowDialog(this) == DialogResult.OK)
            {
                //try
                //{
                Layer sLayer = DataIO.ReadShp(mReadLayerDialog.FileName);
                if (mMap == null)
                {
                    Map sMap = new Map();
                    BandNewMap(sMap);
                }
                mMap.AddLayer(sLayer);
                SelectLayer(sLayer);

                //}
                //catch(Exception e)
                //{
                //    MessageBox.Show(e.Message, "读取shp文件失败");
                //}
            }
        }
Example #7
0
    private SortedList <int, bool> CoefFlag = new SortedList <int, bool>();    //0722

    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();
        SetSessionBlockType(7);
        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = ConfigurationManager.AppSettings["DbName"].ToString();
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        mysql = new SqlManager(serverName, dbName, userId, pwd);
        creattNavi();
        string sntest = Request.QueryString["uSN"];

        if (TextBox1.Text == "")
        {
            TextBox1.Text = sntest;
        }
        if (TextBox1.Text != "")
        {
            gridviewdatabind();
        }
    }
Example #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();

        conn = "inpcsz0518\\ATS_HOME";
        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = "";
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        if (Session["DB"] == null)
        {
            Response.Redirect("~/Default.aspx", true);
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName"].ToString();
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
        }
        pDataIO = null;
        pDataIO = new SqlManager(serverName, dbName, userId, pwd);

        Session["TreeNodeExpand"] = null;
        SetSessionBlockType(1);
        moduleTypeID        = Request["uId"];
        SourceFlowControlID = Request["sourceID"];
        connectDataBase();
        ConfigOptionButtonsVisible();

        int myAccessCode = 0;

        if (Session["AccCode"] != null)
        {
            myAccessCode = Convert.ToInt32(Session["AccCode"]);
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //if (!IsPostBack)
        {
            IsSessionNull();

            rowCount = 0;
            conn     = "inpcsz0518\\ATS_HOME";
            string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
            string dbName     = "";
            string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
            string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

            if (Session["DB"] == null)
            {
                Response.Redirect("~/Default.aspx", true);
            }
            else if (Session["DB"].ToString().ToUpper() == "ATSDB")
            {
                dbName = ConfigurationManager.AppSettings["DbName"].ToString();
            }
            else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
            {
                dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
            }
            pDataIO = null;
            pDataIO = new SqlManager(serverName, dbName, userId, pwd);
            //pDataIO = new SqlManager(conn);
            mydt.Clear();

            Session["TreeNodeExpand"] = null;
            SetSessionBlockType(1);
            moduleTypeID = Request["uId"];
            connectDataBase();
            LoadOptionButton();
            ConfigOptionButtonsVisible();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = "";
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        if (Session["DB"] == null)
        {
            Response.Redirect("~/Default.aspx", true);
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName"].ToString();
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
        }

        pDataIO = null;
        pDataIO = new SqlManager(serverName, dbName, userId, pwd);
        if (pDataIO.OpenDatabase(true))
        {
            DataTable blockListDt = pDataIO.GetDataTable("select * from FunctionTable where blockLevel = 0 and PID=0", "BlockList");
            for (int j = 0; j < blockListDt.Rows.Count; j++)
            {
                AddDdlBlockTypeLstItem(new ListItem(blockListDt.Rows[j]["ItemName"].ToString()));
            }
        }

        loadOK = true;

        string ss = DdlParentItem;

        getDdlInfo(true);
        DdlParentItem = ss;
    }
Example #11
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();

        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = "";
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        if (Session["DB"] == null)
        {
            Response.Redirect("~/Default.aspx", true);
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName"].ToString();
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
        }

        pDataIO = null;
        pDataIO = new SqlManager(serverName, dbName, userId, pwd);

        if (Session["AccCode"] != null)
        {
            myAccessCode = Convert.ToInt32(Session["AccCode"]);
        }
        if (myAccessCode == 85004561 && Request.Url.ToString().Contains("UserRoleFunc"))
        {
            Response.Redirect("~/Home.aspx");
        }
        else
        {
            initPage();
        }
    }
Example #12
0
        static void Main(string[] args)
        {
            Console.WriteLine("Configure dataio and mainwindow");

            //when initializing the object of dataio, it uses the constructor to read from the csv file to get the data ready, so the window afterwards can use these data
            DataIO dataIO = new DataIO();

            //initialize the main window view to use dependency injection to inject itself to the presenter, so the view and
            MainWindow mainwindow = new MainWindow();


            //debug whether the data has been correctly read from the file
            // Console.WriteLine(dataIO.Subjects.Count);
            //   Console.WriteLine(dataIO.Tutorials.Count);
            //  Console.WriteLine(dataIO.Teachers.Count);



            MainWindowPresenter MainwindowPresenter = new MainWindowPresenter(mainwindow, dataIO);

            //use the method from presenter to present the view
            MainwindowPresenter.getMainView().ShowDialog();
        }
        // ! Salva una copia del flat pattern come dxf
        public static bool saveDxf(string pathToSave, PartDocument oDoc)
        {
            //string sOut = "FLAT PATTERN DXF?AcadVersion=2004"
            //    + "&TangentLinesLayer=IV_TANGENT&TangentLinesLayerColor=255;0;0";

            string sOut = "FLAT PATTERN DXF?AcadVersion=2000"
                          + "&OuterProfileLayer=OUTER_PROF&OuterProfileLayerColor=255;0;0"
                          + "&InteriorProfilesLayer=INNER_PROFS&InteriorProfilesLayerColor=0;0;0"
                          + "&FeatureProfileLayer=FEATURE&FeatureProfileLayerColor=0;0;0"
                          + "&BendUpLayer=BEND_UP&BendUpLayerColor=0;255;0&BendUpLayerLineType=37634"
                          + "&BendDownLayer=BEND_DOWN&BendDownLayerColor=0;255;0&BendDownLayerLineType=37634";

            SheetMetalComponentDefinition oCompDef;

            try
            {
                oCompDef = (SheetMetalComponentDefinition)oDoc.ComponentDefinition;
            }
            catch
            {
                return(false);
            }

            if (!oCompDef.HasFlatPattern)
            {
                return(false);

                throw new Exception("Non è presente il flat pattern!");
            }

            DataIO oDataIO = oCompDef.DataIO;

            string dxfName = @pathToSave + "\\" + oDoc.DisplayName + ".dxf";

            oDataIO.WriteDataToFile(sOut, dxfName);
            return(true);
        }
Example #14
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();

        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = "";
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        if (Session["DB"] == null)
        {
            Response.Redirect("~/Default.aspx", true);
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName"].ToString();
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
        }

        pDataIO = null;
        pDataIO = new SqlManager(serverName, dbName, userId, pwd);

        if (Session["UserID"] != null)
        {
            currID       = Session["UserID"].ToString();
            lblInfo.Text = "";
        }
        else
        {
            this.ChangeFunc.Visible = false;
            ClientScript.RegisterStartupScript(GetType(), "Message", "<Script>alert('Error!Can not find any user control~')</Script>", false);
        }
    }
        public IconMappingPresets Load()
        {
            IconMappingPresets result = null;

            try
            {
                result = DataIO.LoadFromFile <IconMappingPresets>(Path.Combine(App.ApplicationPath, Constants.IconNameFile));
                //no mappings = old version of file without version info
                if (result?.IconNameMappings == null)
                {
                    var oldIconMapping = DataIO.LoadFromFile <List <IconNameMap> >(Path.Combine(App.ApplicationPath, Constants.IconNameFile));
                    result.IconNameMappings = oldIconMapping;

                    result.Version = string.Empty;
                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine($"Error loading the icon name mapping file.{Environment.NewLine}{ex}");
                throw;
            }

            return(result);
        }
Example #16
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();

        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = "";
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        if (Session["DB"] == null)
        {
            Response.Redirect("~/Default.aspx", true);
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName"].ToString();
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
        }
        pDataIO = null;
        pDataIO = new SqlManager(serverName, dbName, userId, pwd);

        Session["TreeNodeExpand"] = null;
        SetSessionBlockType(3);
        globalSpecListDt = pDataIO.GetDataTable("select * from GlobalSpecs order by ItemName", "GlobalSpecs");
        if (Request.QueryString["uId"] != null)
        {
            ReportHeaderID = Request.QueryString["uId"];
        }
        queryStr = "select * from ReportHeaderSpecs where PID=" + ReportHeaderID;
        mydt     = pDataIO.GetDataTable(queryStr, "ReportHeaderSpecs");
        connectDataBase();
        ConfigOptionButtonsVisible();
    }
Example #17
0
    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();
        SetSessionBlockType(7);
        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = ConfigurationManager.AppSettings["DbName"].ToString();
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        mysql = new SqlManager(serverName, dbName, userId, pwd);
        creattNavi();
        if (!this.IsPostBack)
        {
            TextBox5.Text = DateTime.Now.AddDays(-5).ToString();
            //TextBox5.Text = "2014/4/7 15:36:01";
            TextBox6.Text = DateTime.Now.ToString();


            string selectcmd = "select distinct (ItemName) from GlobalProductionType where IgnoreFlag=0";
            bool   flag      = mysql.OpenDatabase(true);
            if (flag == false)
            {
                this.Page.ClientScript.RegisterStartupScript(GetType(), " ", "alert('database failure in link!');", true);
                //Response.Write("<script>alert('database failue in link!');</script>");
            }
            else
            {
                DropDownList1.Items.Add("");
                DataTable dt1 = mysql.GetDataTable(selectcmd, "GlobalProductionType");
                for (int i = 0; i < dt1.Rows.Count; i++)
                {
                    DropDownList1.Items.Add(dt1.Rows[i]["ItemName"].ToString());
                }
            }
        }
    }
Example #18
0
        protected void WriteTagListInc(DataIO pData, uint nIncreaseTagNumber = 0)
        {
            // write taglist and add name + size tag
            if (pData == null)
            {
                Debug.Assert(false);
                return;
            }

            uint uCount = GetTagCount() + nIncreaseTagNumber; // will include name and size tag in the count if needed

            Debug.Assert(uCount <= 0xFF);
            pData.WriteByte((byte)uCount);

            KadTagValueString strCommonFileName(GetCommonFileName());

            if (!strCommonFileName.IsEmpty())
            {
                Debug.Assert(uCount > m_listTag.size());
                KadTagStr tag(TAG_FILENAME, strCommonFileName);

                pData->WriteTag(&tag);
            }
            if (m_uSize != 0)
            {
                Debug.Assert(uCount > m_listTag.size());
                KadTagUInt tag(TAG_FILESIZE, m_uSize);

                pData->WriteTag(&tag);
            }

            for (TagList::const_iterator itTagList = m_listTag.begin(); itTagList != m_listTag.end(); ++itTagList)
            {
                pData->WriteTag(*itTagList);
            }
        }
Example #19
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dataIO                = new DataIO(PATH);
            figureList            = new FigureList();
            figureList.ObjectList = new List <Shape>();
            try
            {
                figureList.ObjectList = dataIO.LoadData();
                if (!(figureList.ObjectList.Count == 0))
                {
                    foreach (Shape obj in figureList.ObjectList)
                    {
                        FigureField.Children.Add(obj);
                    }
                }

                RefreshPlugins();
                InitializeGUIComponents();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void LoadClips(Recorder recorder, string filename, string foldername)
        {
            var rawJson = DataIO.Load(filename);
            var clip    = Instantiate(recorder.prefabSequence);
            var cc      = JsonUtility.FromJson <Clip>(rawJson);

            clip.frames = new Anim.Data.Frame[cc.data.GetLength(0)];
            for (int i = 0; i < clip.frames.Length; ++i)
            {
                var f = new Anim.Data.Frame();
                f.joints = new Anim.Data.Joint[21];
                for (int j = 0; j < f.joints.Length; ++j)
                {
                    var jd = j * 3;
                    f.joints[j] = new Anim.Data.Joint();
                    f.joints[j].x.TargetValue = cc.data[i].joints[jd];
                    f.joints[j].y.TargetValue = cc.data[i].joints[jd + 1];
                    f.joints[j].z.TargetValue = cc.data[i].joints[jd + 2];
                }

                clip.frames[i] = f;
            }
            recorder.clip = clip;
        }
        private string ConvertToRDFRequest(string req, string version)
        {
            string searchstring = string.Empty;
            string exactphrase  = string.Empty;
            string fname        = string.Empty;
            string lname        = string.Empty;

            string ecomid    = string.Empty;
            string personid  = string.Empty;
            string harvardid = string.Empty;

            string institution          = string.Empty;
            string institutionallexcept = string.Empty;
            string department           = string.Empty;
            string departmentallexcept  = string.Empty;
            string facultyrank          = string.Empty;

            string division          = string.Empty;
            string divisionallexcept = string.Empty;
            string classuri          = "http://xmlns.com/foaf/0.1/Person";
            int    limit             = 100;
            int    offset            = 0;
            string sortby            = string.Empty;
            string sortdirection     = string.Empty;
            string otherfilters      = string.Empty;

            XmlDocument newrequest = new XmlDocument();

            XmlDocument request = new XmlDocument();

            req = req.Replace("\n", "").Replace("\r", "");
            req = req.Replace("<?xml version=\"1.0\" encoding=\"utf-16\"?>", "");
            req = req.Replace("xmlns=\"http://connects.profiles.schema/profiles/query\"", "");
            request.LoadXml(req);

            if (request.SelectSingleNode("//Profiles/QueryDefinition/PersonID") != null)
            {
                personid = request.SelectSingleNode("//Profiles/QueryDefinition/PersonID").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/InternalIDList/InternalID[@Name = 'EcommonsUsername']") != null)
            {
                ecomid = request.SelectSingleNode("//Profiles/QueryDefinition/InternalIDList/InternalID[@Name = 'EcommonsUsername']").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/InternalIDList/InternalID[@Name = 'HarvardID']") != null)
            {
                harvardid = request.SelectSingleNode("//Profiles/QueryDefinition/InternalIDList/InternalID[@Name = 'HarvardID']").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/Keywords/KeywordString") != null)
            {
                searchstring = request.SelectSingleNode("//Profiles/QueryDefinition/Keywords/KeywordString").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/Keywords/KeywordString/@MatchType") != null)
            {
                exactphrase = request.SelectSingleNode("//Profiles/QueryDefinition/Keywords/KeywordString/@MatchType").Value;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/Name/FirstName") != null)
            {
                fname = request.SelectSingleNode("//Profiles/QueryDefinition/Name/FirstName").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/Name/LastName") != null)
            {
                lname = request.SelectSingleNode("//Profiles/QueryDefinition/Name/LastName").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DepartmentName") != null)
            {
                department = request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DepartmentName").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DepartmentName/@Exclude") != null)
            {
                departmentallexcept = request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DepartmentName/@Exclude").Value;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DivisionName") != null)
            {
                division = request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DivisionName").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DivisionName/@Exclude") != null)
            {
                divisionallexcept = request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/DivisionName/@Exclude").Value;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/InstitutionName") != null)
            {
                institution = request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/InstitutionName").InnerText;
            }

            if (request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/InstitutionName/@Exclude") != null)
            {
                institutionallexcept = request.SelectSingleNode("//Profiles/QueryDefinition/AffiliationList/Affiliation/InstitutionName/@Exclude").Value;
            }

            if (request.SelectSingleNode("//Profiles/OutputOptions/@StartRecord") != null)
            {
                offset = Convert.ToInt32(request.SelectSingleNode("//Profiles/OutputOptions/@StartRecord").Value);
            }

            if (request.SelectSingleNode("//Profiles/OutputOptions/@MaxRecords") != null)
            {
                limit = Convert.ToInt32(request.SelectSingleNode("//Profiles/OutputOptions/@MaxRecords").Value);
            }

            if (offset > 0)
            {
                offset--;
            }


            if (request.SelectSingleNode("//Profiles/OutputOptions/@SortType") != null)
            {
                sortby = request.SelectSingleNode("//Profiles/OutputOptions/@SortType").Value;
            }



            foreach (XmlNode others in request.SelectNodes("Profiles/QueryDefinition/PersonFilterList/PersonFilter"))
            {
                otherfilters += others.InnerText + ", ";
            }

            if (otherfilters != string.Empty)
            {
                otherfilters = otherfilters.Substring(0, otherfilters.Length - 3);
            }


            DataIO data = new DataIO();

            newrequest = data.SearchRequest(searchstring, exactphrase, fname, lname, institution, institutionallexcept, department, departmentallexcept,
                                            division, divisionallexcept, classuri, limit.ToString(), offset.ToString(), sortby, sortdirection, otherfilters, personid, ecomid, harvardid);


            return(newrequest.InnerXml);
        }
Example #22
0
    /// <summary>
    /// 创建导航的链接
    /// </summary>
    /// <param name="blockFuncName">当前页面的BlockFucName</param>
    /// <param name="parentItem">当前页面的父项资料名称 (eg:当前页面为PNList,父项为TypeList="QSFP28",则parentItem="QSFP28")</param>
    /// <param name="blockFuncTypeID">当前的功能块ID</param>
    /// <param name="pIO">数据库连接IO</param>
    /// <returns>返回一个包含资料的Control,可直接新增使用!</returns>
    public Control CreateNaviCtrl(string blockFuncName, string parentItem, string blockFuncTypeID, DataIO pIO, out string NaviString, bool isAddNewModel = false)
    {
        NaviString = "";
        Control   naviCtrl = new System.Web.UI.Control();
        int       level    = -1;
        DataTable typeDt   = pIO.GetDataTable("select * from FunctionTable", "");

        DataRow[] drs = typeDt.Select("ItemName='" + blockFuncName + "' and BlockTypeID =" + blockFuncTypeID);
        if (drs.Length == 1)
        {
            level = Convert.ToInt32(drs[0]["BlockLevel"]);
            if (HttpContext.Current.Session["currMaxLevel_" + blockFuncTypeID] == null || level > Convert.ToInt32(HttpContext.Current.Session["currMaxLevel" + blockFuncTypeID]))
            {
                HttpContext.Current.Session["currMaxLevel_" + blockFuncTypeID] = level;
            }
            //将原有的level>currLevel的session资料销毁
            for (int m = level; m < Convert.ToInt32(HttpContext.Current.Session["currMaxLevel"]); m++)
            {
                HttpContext.Current.Session["LevelID_" + blockFuncTypeID + m + "_Page"] = null;
                HttpContext.Current.Session["txtLevelID_" + blockFuncTypeID + m]        = null;
            }

            HttpContext.Current.Session["LevelID_" + blockFuncTypeID + level + "_Page"] = HttpContext.Current.Request.RawUrl;
            HttpContext.Current.Session["txtLevelID_" + blockFuncTypeID + level]        = blockFuncName;

            if ((level - 1) >= 0)
            {
                if (isAddNewModel)
                {
                    HttpContext.Current.Session["LevelID_" + blockFuncTypeID + (level - 1) + "_Page"] = HttpContext.Current.Request.RawUrl;
                }
                else if (HttpContext.Current.Session["LevelID_" + blockFuncTypeID + (level - 1) + "_Page"] == null)
                {
                    HttpContext.Current.Session["LevelID_" + blockFuncTypeID + (level - 1) + "_Page"] = "";
                }
                HttpContext.Current.Session["txtLevelID_" + blockFuncTypeID + (level - 1)] = parentItem;
            }

            HyperLink[] hlk;

            drs = typeDt.Select("BlockTypeID=" + blockFuncTypeID, "BlockLevel,PID,ID");
            hlk = new HyperLink[level + 1];
            for (int i = 0; i < level + 1; i++)
            {
                hlk[i]             = new HyperLink();
                hlk[i].NavigateUrl = HttpContext.Current.Session["LevelID_" + blockFuncTypeID + i + "_Page"].ToString();
                hlk[i].Text        = HttpContext.Current.Session["txtLevelID_" + blockFuncTypeID + i].ToString();

                if (i == 0)
                {
                    NaviString += hlk[i].Text;
                    naviCtrl.Controls.Add(hlk[i]);
                }
                else
                {
                    NaviString += ">>" + hlk[i].Text;
                    HtmlGenericControl hgc = new HtmlGenericControl("span");
                    hgc.InnerText = ">>";
                    naviCtrl.Controls.Add(hgc);
                    naviCtrl.Controls.Add(hlk[i]);
                }
            }
        }
        return(naviCtrl);
    }
Example #23
0
        static void Main(string[] args)
        {
            DataIO serializer = new DataIO();
            Random random     = new Random((int)DateTime.Now.Ticks);

            AppUsers.Add(new AppUser()
            {
                Id                  = random.Next(),
                Name                = "admin",
                Surname             = "admin",
                UserName            = "******",
                ContactPhone        = "021/12345",
                Email               = "*****@*****.**",
                Password            = "******",
                Role                = "Admin",
                RegistrationDate    = DateTime.Now,
                BookmarkedSubforums = new List <string>(),
                ReceivedMessages    = new List <Message>()
                {
                    new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "Bem ti lebac"
                    }, new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "aaaaaaaaa"
                    }
                },
                SavedComments = new List <Comment>(),
                SavedTopics   = new List <Topic>()
            });
            AppUsers.Add(new AppUser()
            {
                Id                  = random.Next(),
                Name                = "mica",
                Surname             = "micic",
                UserName            = "******",
                ContactPhone        = "021/12345",
                Email               = "*****@*****.**",
                Password            = "******",
                Role                = "Moderator",
                RegistrationDate    = DateTime.Now,
                BookmarkedSubforums = new List <string>(),
                ReceivedMessages    = new List <Message>()
                {
                    new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "Bem ti lebac"
                    }, new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "aaaaaaaaa"
                    }
                },
                SavedComments = new List <Comment>(),
                SavedTopics   = new List <Topic>()
            });
            AppUsers.Add(new AppUser()
            {
                Id                  = random.Next(),
                Name                = "Aleksandar",
                Surname             = "Misljenovic",
                UserName            = "******",
                Email               = "*****@*****.**",
                Password            = "******",
                Role                = "AppUser",
                ContactPhone        = "021/1353545",
                RegistrationDate    = DateTime.Now,
                BookmarkedSubforums = new List <string>(),
                ReceivedMessages    = new List <Message>()
                {
                    new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "opassada"
                    }, new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "ajsasa"
                    }
                },
                SavedComments = new List <Comment>(),
                SavedTopics   = new List <Topic>()
            });

            AppUsers.Add(new AppUser()
            {
                Id                  = random.Next(),
                Name                = "Moderator",
                Surname             = "Moderator",
                ContactPhone        = "021/8778585",
                UserName            = "******",
                Email               = "*****@*****.**",
                Password            = "******",
                Role                = "Moderator",
                RegistrationDate    = DateTime.Now,
                BookmarkedSubforums = new List <string>(),
                ReceivedMessages    = new List <Message>()
                {
                    new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "mhmhm"
                    }, new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "frik"
                    }
                },
                SavedComments = new List <Comment>(),
                SavedTopics   = new List <Topic>()
            });

            AppUsers.Add(new AppUser()
            {
                Id                  = random.Next(),
                Name                = "Aleksandar",
                Surname             = "Misljenovic",
                UserName            = "******",
                Email               = "*****@*****.**",
                Password            = "******",
                Role                = "AppUser",
                ContactPhone        = "021/1353545",
                RegistrationDate    = DateTime.Now,
                BookmarkedSubforums = new List <string>(),
                ReceivedMessages    = new List <Message>()
                {
                    new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "opassada"
                    }, new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "ajsasa"
                    }
                },
                SavedComments = new List <Comment>(),
                SavedTopics   = new List <Topic>()
            });

            AppUsers.Add(new AppUser()
            {
                Id                  = random.Next(),
                Name                = "Aleksandar",
                Surname             = "Misljenovic",
                UserName            = "******",
                Email               = "*****@*****.**",
                Password            = "******",
                Role                = "AppUser",
                ContactPhone        = "021/1353545",
                RegistrationDate    = DateTime.Now,
                BookmarkedSubforums = new List <string>(),
                ReceivedMessages    = new List <Message>()
                {
                    new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "opassada"
                    }, new Message {
                        Id = random.Next(), SenderUsername = "******", Content = "ajsasa"
                    }
                },
                SavedComments = new List <Comment>(),
                SavedTopics   = new List <Topic>()
            });

            CreateSubforum(random, "Funny", "hot topics", "do w/e", "moderator", "http://localhost:54042/Content/Icons/icon-0.ico");
            CreateSubforum(random, "World", "controversial topics", "w/e", "mica", "http://localhost:54042/Content/Icons/icon-1.ico");
            CreateSubforum(random, "Movies", "new topics", "w/e", "mica", "http://localhost:54042/Content/Icons/icon-2.ico");
            CreateSubforum(random, "Gaming", "opular topics", "w/e", "moderator", "http://localhost:54042/Content/Icons/icon-3.ico");
            Subforum sub = Subforums[0];

            CreateTopic(random, "Topic 1",
                        "mica", TopicType.Text, "test test", Subforums[0]);
            CreateTopic(random, "Topic 2", "mica", TopicType.Text, "test test", Subforums[1]);
            CreateTopic(random, "Topic 3", "mica", TopicType.Text, "test test", Subforums[2]);
            CreateTopic(random, "Topic 4", "mica", TopicType.Text, "test test", Subforums[3]);
            CreateTopic(random, "Topic 5 ", "mica", TopicType.Text, "test test", Subforums[0]);
            CreateTopic(random, "Topic 8", "mica", TopicType.Text, "test test", Subforums[0]);
            CreateTopic(random, "Topic 7", "mica", TopicType.Text, "test test", Subforums[1]);
            CreateTopic(random, "Topic 8", "mica", TopicType.Text, "test test", Subforums[2]);
            CreateTopic(random, "Topic 6", "mica", TopicType.Text, "test test", Subforums[3]);

            CreateComment(random, "jedan", "mica", Subforums[0], 0);
            CreateComment(random, "dva", "mica", Subforums[1], 1);
            CreateComment(random, "tri", "mica", Subforums[2], 1);
            CreateComment(random, "cetiri", "mica", Subforums[3], 1);
            CreateComment(random, "pet", "aca", Subforums[0], 1);
            CreateComment(random, "sest", "aca", Subforums[1], 1);
            CreateComment(random, "sedam", "aca", Subforums[2], 1);
            CreateComment(random, "osam", "aca", Subforums[3], 1);
            CreateComment(random, "devet", "aca", Subforums[0], 0);
            CreateChildComment(random, "deset", "aca", Subforums[0], 0, Subforums[0].Topics[0].Comments[0].Id);
            CreateComplaint(random, "zzzzzzzzzz", EntityType.Comment, Subforums[0].Topics[0].Comments[0].Id, Subforums[0].Topics[0].Comments[0].TopicId, Subforums[0].Topics[0].Comments[0].AuthorUsername, "aca");
            CreateComplaint(random, "bbbbbbbbbb", EntityType.Subforum, Subforums[0].Id, -1, Subforums[0].LeadModeratorUsername, "aca");
            CreateComplaint(random, "kkkkkkkkkk", EntityType.Topic, Subforums[0].Topics[0].Id, -1, Subforums[0].Topics[0].AuthorUsername, "aca");

            serializer.SerializeObject(AppUsers, "AppUsers");
            serializer.SerializeObject(Complaints, "Complaints");
            serializer.SerializeObject(Subforums, "Subforums");
        }
        public override IProfileConnection GetConnection()
        {
            var dataIO = new DataIO();

            // Loop through reader and fill object
            using (var rdr = dataIO.GetProfileConnection(new RDFTriple(this.Subject.NodeId, 0, this.Object.NodeId), this.StoredProcedure))
            {
                bool headerLoaded = false;
                while (rdr.Read())
                {
                    // Data is denormalized.  Load header object once
                    if (headerLoaded == false)
                    {
                        this.ConnectionStrength = double.Parse(rdr["TotalOverallWeight"].ToString());
                    }

                    this.ConnectionDetails.Add(new Publication
                    {
                        PMID = long.Parse(rdr["PMID"].ToString()),
                        Description = rdr["Reference"].ToString(),
                        Score = double.Parse(rdr["OverallWeight"].ToString())
                    });

                    headerLoaded = true;
                }
            }

            return this;
        }
    protected void GetResultXMLDocument()
    {
        string QueryID = Request["QueryID"];
            if (QueryID != "")
            {
                SqlDataReader dr;
                DataIO oDataIO = new DataIO();
                dr = oDataIO.GetApiQueryHistory(cs(QueryID));
                if (dr.Read())
                {
                    string QueryXML = dr["QueryXML"].ToString();
                    string OrigQueryXML = QueryXML;
                    QueryXML = QueryXML.Replace(" xmlns=\"http://connects.profiles.schema/profiles/query\"", "");
                    XmlDocument objDoc = new XmlDocument();
                    objDoc.LoadXml(QueryXML);
                    XmlElement SearchXML = objDoc.DocumentElement;
                    KeywordString = GetXMLText(SearchXML, "//KeywordString");
                }

                if (!dr.IsClosed)
                    dr.Close();

            }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        DataIO data = new DataIO();

        Response.Write(data.GetEditedCount());
    }
Example #27
0
        public CustomActionManager(MacroManagerViewModel macroManager, ViewModelFactory viewModelFactory, DataIO dataIO, IMessageBoxService messageBoxService)
        {
            this.macroManager      = macroManager;
            this.viewModelFactory  = viewModelFactory;
            this.dataIO            = dataIO;
            this.messageBoxService = messageBoxService;

            LoadDefault();
            LoadCustomActionList(this.savedCustomAction);
            InitializeCommands();
        }
        public Connects.Profiles.Service.DataContracts.PersonList ProfileSearch(Connects.Profiles.Service.DataContracts.Profiles qd, bool isSecure)
        {
            Connects.Profiles.Service.DataContracts.PersonList pl = null;
            string req         = string.Empty;
            string responseXML = string.Empty;

            try
            {
                DataIO            ps            = new DataIO();
                XmlDocument       searchrequest = new XmlDocument();
                Utility.Namespace namespacemgr  = new Connects.Profiles.Utility.Namespace();


                Connects.Profiles.Service.DataContracts.Profiles p = new Connects.Profiles.Service.DataContracts.Profiles();

                req = Connects.Profiles.Utility.XmlUtilities.SerializeToString(qd);

                DebugLogging.Log("+++++++++ REQUEST=" + req);

                Type type = typeof(Connects.Profiles.Service.DataContracts.PersonList);

                searchrequest.LoadXml(this.ConvertToRDFRequest(req, qd.Version.ToString()));



                if (qd.QueryDefinition.PersonID != null && qd.Version != 2)
                {
                    qd.QueryDefinition.PersonID = ps.GetPersonID(qd.QueryDefinition.PersonID).ToString();
                }



                if (qd.QueryDefinition.PersonID != null)
                {
                    responseXML = ps.Search(qd.QueryDefinition.PersonID, isSecure).OuterXml;
                }
                else
                {
                    responseXML = ps.Search(searchrequest, isSecure).OuterXml;
                }


                string queryid = string.Empty;
                queryid = qd.QueryDefinition.QueryID;


                if (responseXML == string.Empty)
                {
                    if (queryid == null)
                    {
                        queryid = Guid.NewGuid().ToString();
                    }


                    responseXML = "<PersonList Complete=\"true\" ThisCount=\"0\" TotalCount=\"0\" QueryID=\"" + queryid + "\" xmlns=\"http://connects.profiles.schema/profiles/personlist\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" />";
                }
                else
                {
                    string version    = string.Empty;
                    bool   individual = false;


                    version = qd.Version.ToString();

                    if (qd.QueryDefinition.PersonID != null || qd.QueryDefinition.InternalIDList != null)
                    {
                        individual = true;
                    }

                    responseXML = ps.ConvertV2ToBetaSearch(responseXML, queryid, version, individual);
                }

                DebugLogging.Log("+++++++++ DONE WITH Convert V2 to Beta Search");
                pl = Connects.Profiles.Utility.XmlUtilities.DeserializeObject(responseXML, type) as Connects.Profiles.Service.DataContracts.PersonList;
                DebugLogging.Log("+++++++++ Returned + a total count of = " + pl.TotalCount);
            }
            catch (Exception ex)
            {
                DebugLogging.Log(req + " " + responseXML);
                DebugLogging.Log("ERROR==> " + ex.Message + " STACK:" + ex.StackTrace + " SOURCE:" + ex.Source);
            }

            return(pl);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        IsSessionNull();
        Session["TreeNodeExpand"] = null;
        SetSessionBlockType(2);
        initsn      = Session["initsn"].ToString();
        Label4.Text = Session["sn"].ToString();
        Label5.Text = Session["testplansel"].ToString();
        Label6.Text = Session["startime"].ToString();
        id          = Request.QueryString["uId"];

        if (Label5.Text == "&nbsp;")
        {
            Label5.Text = "";
        }
        if (Label6.Text == "&nbsp;")
        {
            Label6.Text = "";
        }
        string serverName = ConfigurationManager.AppSettings["ServerName"].ToString();
        string dbName     = "";
        string userId     = ConfigurationManager.AppSettings["UserId"].ToString();
        string pwd        = ConfigurationManager.AppSettings["Pwd"].ToString();

        if (Session["DB"] == null)
        {
            Response.Redirect("~/Default.aspx", true);
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName"].ToString();
        }
        else if (Session["DB"].ToString().ToUpper() == "ATSDEBUGDB")
        {
            dbName = ConfigurationManager.AppSettings["DbName2"].ToString();
        }
        mysql = new SqlManager(serverName, dbName, userId, pwd);
        creattNavi();
        string selectcmd = "select Page as 页数,StartAddr as 开始地址,ItemValue as 值,ItemSize as 长度 from TopoTestCoefBackup where PID= '" + id + "' order by Page ASC,StartAddr ASC ";

        mysql.OpenDatabase(true);
        dt = mysql.GetDataTable(selectcmd, "TopoTestCoefBackup");

        if (dt.Rows.Count != 0)
        {
            GridView1.DataSource = dt;
            GridView1.DataBind();
            GridView1.HeaderRow.Style.Add("word-break", "keep-all");
            for (int i = 0; i < GridView1.Rows.Count; i++)
            {
                if (i % 2 == 0)
                {
                    GridView1.Rows[i].BackColor = System.Drawing.Color.Azure;
                }
                for (int j = 0; j < GridView1.Rows[i].Cells.Count; j++)
                {
                    GridView1.Rows[i].Cells[j].Wrap = false;
                    GridView1.Rows[i].Cells[j].Style.Add("word-break", "keep-all");
                }
            }
        }
        else
        {
            dt.Rows.Add(dt.NewRow());
            GridView1.DataSource = dt;
            GridView1.DataBind();

            //Response.Write("<script>alert('can not find testdata!');</script>");
            //Response.Redirect("~/WebFiles/TestReport/Query.aspx?uSN=" + TextBox1.Text);
        }
    }
        public override IProfileConnection GetConnection()
        {
            var dataIO = new DataIO();

            // Loop through reader and fill object
            using (var rdr = dataIO.GetProfileConnection(new RDFTriple(this.Subject.NodeId, 0, this.Object.NodeId), this.StoredProcedure))
            {
                bool headerLoaded = false;
                while (rdr.Read())
                {
                    // Data is denormalized.  Load header object once
                    if (headerLoaded == false)
                    {
                        this.ConnectionStrength = double.Parse(rdr["TotalOverallWeight"].ToString());
                    }

                    SimilarConcept concept = new SimilarConcept
                    {
                        MeshTerm = rdr["MeshHeader"].ToString(),
                        OverallWeight = double.Parse(rdr["OverallWeight"].ToString()),
                        ConceptProfile = rdr["ObjectURI"].ToString()
                    };

                    concept.Subject.KeywordWeight = double.Parse(rdr["KeywordWeight1"].ToString());
                    concept.Subject.ConceptConnectionURI = rdr["ConnectionURI1"].ToString();
                    concept.Object.KeywordWeight = double.Parse(rdr["KeywordWeight2"].ToString());
                    concept.Object.ConceptConnectionURI = rdr["ConnectionURI2"].ToString();

                    this.ConnectionDetails.Add(concept);

                    headerLoaded = true;
                }
            }

            return this;
        }
Example #31
0
        //***************************************************************************************************************************************
        private void ProcessRequest()
        {
            Framework.Utilities.DebugLogging.Log("{REST.aspx.cs} ProcessRequest() start ");


            string param0 = string.Empty; //Application Name {default for this install is profile}
            string param1 = string.Empty;
            string param2 = string.Empty;
            string param3 = string.Empty;
            string param4 = string.Empty;
            string param5 = string.Empty;
            string param6 = string.Empty;
            string param7 = string.Empty;
            string param8 = string.Empty;
            string param9 = string.Empty;

            XmlDocument frameworkurl = new XmlDocument();

            if (HttpContext.Current.Items["Param0"] != null)
            {
                param0 = HttpContext.Current.Items["Param0"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param1"] != null)
            {
                param1 = HttpContext.Current.Items["Param1"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param2"] != null)
            {
                param2 = HttpContext.Current.Items["Param2"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param3"] != null)
            {
                param3 = HttpContext.Current.Items["Param3"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param4"] != null)
            {
                param4 = HttpContext.Current.Items["Param4"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param5"] != null)
            {
                param5 = HttpContext.Current.Items["Param5"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param6"] != null)
            {
                param6 = HttpContext.Current.Items["Param6"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param7"] != null)
            {
                param7 = HttpContext.Current.Items["Param7"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param8"] != null)
            {
                param8 = HttpContext.Current.Items["Param8"].ToString();
            }
            else
            {
            }

            if (HttpContext.Current.Items["Param9"] != null)
            {
                param9 = HttpContext.Current.Items["Param9"].ToString();
            }
            else
            {
            }

            DataIO data = new DataIO();

            //Alias.aspx is the hub for maintaining session state. With the exception of a log in Function.
            //the Framework.Session is created and loaded into memory at the point a user session is created in the Global.asax file.
            //When a session has expired the Framework.Session.SessionLogout() method is called.
            SessionManagement sessionmanagement = new SessionManagement();
            Session           session           = sessionmanagement.Session();

            URLResolve resolve = data.GetResolvedURL(param0,
                                                     param1,
                                                     param2,
                                                     param3,
                                                     param4,
                                                     param5,
                                                     param6,
                                                     param7,
                                                     param8,
                                                     param9,
                                                     session.SessionID,
                                                     Root.Domain + Root.AbsolutePath,
                                                     session.UserAgent,
                                                     getBestAcceptType(HttpContext.Current.Request.AcceptTypes));


            Framework.Utilities.DebugLogging.Log("{REST.aspx.cs} ProcessRequest() redirect=" + resolve.Redirect.ToString() + " to=>" + resolve.ResponseURL);


            if (resolve.Resolved && !resolve.Redirect)
            {
                string URL = resolve.ResponseURL;
                Server.Execute(HttpUtility.HtmlDecode(URL));
            }
            else if (resolve.Resolved && resolve.Redirect)
            {
                Response.Redirect(resolve.ResponseURL, true);
            }
            else
            {
                Response.Redirect(Root.Domain + "/search", true);


                //Response.Write("<b>Debug 404-- Your URL does not match a known Profiles RESTful pattern ---</b><br/><br/> ");

                //Response.Write("<br/>0: ");
                //Response.Write(param0);

                //Response.Write("<br/>1: ");
                //Response.Write(param1);

                //Response.Write("<br/>2: ");
                //Response.Write(param2);

                //Response.Write("<br/>3: ");
                //Response.Write(param3);

                //Response.Write("<br/>4: ");
                //Response.Write(param4);

                //Response.Write("<br/>5: ");
                //Response.Write(param5);

                //Response.Write("<br/>6: ");
                //Response.Write(param6);

                //Response.Write("<br/>7: ");
                //Response.Write(param7);

                //Response.Write("<br/>8: ");
                //Response.Write(param8);

                //Response.Write("<br/>9: ");
                //Response.Write(param9);

                //Response.Write("<br/><br/>Domain: ");
                //Response.Write(Root.Domain);

                //throw new Exception("custom 404 needed here");
            }

            Framework.Utilities.DebugLogging.Log("{REST.aspx.cs} ProcessRequest() end ");
        }
    protected void DrawUIOnLoad()
    {
        string DirectServiceURL = ConfigurationSettings.AppSettings["DirectServiceURL"];
        string ProfilesURL = ConfigurationSettings.AppSettings["URLBASE"]; ;
        string PopulationTypeText = ConfigurationSettings.AppSettings["DirectPopulationType"];
        int QueryTimeout = 15;

        try
        {
            QueryTimeout = Convert.ToInt16(ConfigurationSettings.AppSettings["DirectQueryTimeout"]);
        }
        catch { }

        string sql = string.Empty;
        string ResultDetailsURL = string.Empty;
        string strResult = "";

        XmlElement ResultXML = null;
        SqlDataReader dr;

        oDataIO = new DataIO();

        SqlConnection Conn = new SqlConnection();

        Conn = oDataIO.GetDBConnection("ProfilesDB");

        sqlCmd = new SqlCommand();
        sqlCmd.Connection = Conn;

        if (Request["Request"] == null) { return; }

        string task = Request["Request"].ToLower();
        switch (task)
        {
            case "getsites":
                string ResultStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" + "<site-list>";

                dr = oDataIO.GetSitesOrderBySortOrder();
                while (dr.Read())
                {
                    Int64 SiteID = Convert.ToInt64(dr["SiteID"]);
                    string SiteName = dr["SiteName"].ToString();
                    string QueryURL = dr["QueryURL"].ToString();
                    if (SiteName == null) SiteName = "";
                    if (QueryURL == null) QueryURL = "";
                    ResultStr = ResultStr + "<site-description><site-id>" + SiteID + "</site-id><name>" + cx(SiteName) + "</name><aggregate-query>" + cx(QueryURL) + "</aggregate-query></site-description>";
                }

                if (!dr.IsClosed)
                    dr.Close();

                if (Conn.State == System.Data.ConnectionState.Open)
                    Conn.Close();

                ResultStr += "</site-list>";
                Response.ContentType = "text/xml";
                Response.AddHeader("Content-Type", "text/xml;charset=UTF-8");
                //Response.ContentEncoding.CodePage = 65001;
                Response.Charset = "UTF-8";

                Response.Write(ResultStr);

                break;
            case "incomingcount":

                string q = Request["SearchPhrase"].Trim();
                // Enter log record
                sql = "insert into FSLogIncoming(Details,ReceivedDate,RequestIP,QueryString) " +
                     " values (0,GetDate()," + cs(Request.ServerVariables["REMOTE_ADDR"]) + "," + cs(q) + ")";
                sqlCmd.CommandText = sql;
                sqlCmd.CommandType = System.Data.CommandType.Text;
                // Execute query
                string QueryXML = "<Profiles Operation=\"GetPersonList\" Version=\"2\" xmlns=\"http://connects.profiles.schema/profiles/query\"><QueryDefinition><Name><LastName></LastName><FirstName></FirstName></Name><FacultyTypeList></FacultyTypeList><FacultyRankList></FacultyRankList><Affiliations><AffiliationList><Affiliation><InstitutionName></InstitutionName><DepartmentName></DepartmentName></Affiliation></AffiliationList></Affiliations><PersonFilterList></PersonFilterList><Keywords><KeywordString>" + cx(q) + "</KeywordString></Keywords></QueryDefinition><OutputOptions StartRecord=\"1\" MaxRecords=\"1\"></OutputOptions></Profiles>";
                dr = oDataIO.GetPersonList_xml(cs(QueryXML));
                if (dr.Read())
                {
                    strResult = dr[0].ToString();
                }

                if (!dr.IsClosed)
                    dr.Close();

                if (sqlCmd.Connection.State == System.Data.ConnectionState.Open)
                    sqlCmd.Connection.Close();

                // Parse results
                strResult = strResult.Replace(" xmlns=\"http://connects.profiles.schema/profiles/personlist\"", "");
                XmlDocument objDoc = new XmlDocument();
                objDoc.LoadXml(strResult);
                ResultXML = objDoc.DocumentElement;
                string QueryID = ResultXML.GetAttribute("QueryID");
                string ResultCount = ResultXML.GetAttribute("TotalCount");

                // Form result message
                ResultStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";
                ResultStr += "<aggregation-result>";
                ResultStr += "<count>" + ResultCount + "</count>";
                ResultStr += "<population-type>" + PopulationTypeText + "</population-type>";
                ResultStr += "<preview-URL>" + DirectServiceURL + "?Request=IncomingPreview&amp;SearchPhrase=" + cx(q) + "</preview-URL>";
                ResultStr += "<search-results-URL>" + DirectServiceURL + "?Request=IncomingDetails&amp;SearchPhrase=" + cx(q) + "</search-results-URL>";
                ResultStr += "</aggregation-result>";

                // Send result
                Response.ContentType = "text/xml";
                Response.AddHeader("Content-Type", "text/xml;charset=UTF-8");
                //Response.ContentEncoding.CodePage = 65001;
                Response.Charset = "UTF-8";
                Response.Write(ResultStr);
                break;

            case "incomingdetails":

                q = Request["SearchPhrase"].Trim();

                // Enter log record
                sql = "insert into FSLogIncoming(Details,ReceivedDate,RequestIP,QueryString) ";
                sql += " values (1,GetDate()," + cs(Request.ServerVariables["REMOTE_ADDR"]) + "," +
                        cs(q) + ")";
                sqlCmd.CommandType = System.Data.CommandType.Text;
                sqlCmd.CommandText = sql;
                int iResult = sqlCmd.ExecuteNonQuery();

                // Execute queryA
                QueryXML = "<Profiles Operation=\"GetPersonList\" Version=\"2\" xmlns=\"http://connects.profiles.schema/profiles/query\"><QueryDefinition><Name><LastName></LastName><FirstName></FirstName></Name><FacultyTypeList></FacultyTypeList><FacultyRankList></FacultyRankList><Affiliations><AffiliationList><Affiliation><InstitutionName></InstitutionName><DepartmentName></DepartmentName></Affiliation></AffiliationList></Affiliations><PersonFilterList></PersonFilterList><Keywords><KeywordString>" + cx(q) + "</KeywordString></Keywords></QueryDefinition><OutputOptions StartRecord=\"1\" MaxRecords=\"1\"></OutputOptions></Profiles>";
                dr = oDataIO.GetPersonList_xml(cs(QueryXML));

                if (dr.Read())
                    strResult = dr[0].ToString();

                if (!dr.IsClosed)
                    dr.Close();

                if (sqlCmd.Connection.State == System.Data.ConnectionState.Open)
                    sqlCmd.Connection.Close();

                // Parse results
                strResult = strResult.Replace(" xmlns=\"http://connects.profiles.schema/profiles/personlist\"", "");
                objDoc = new XmlDocument();
                objDoc.LoadXml(strResult);
                ResultXML = objDoc.DocumentElement;
                QueryID = ResultXML.GetAttribute("QueryID");
                ResultCount = ResultXML.GetAttribute("TotalCount");

                if (ProfilesURL.Substring(ProfilesURL.Length - 1) != "/") { ProfilesURL += "/"; }
                Response.Redirect(ProfilesURL + "Search.aspx?From=SP&Keyword=" + q);

                break;
            case "incomingpreview":

                q = Request["SearchPhrase"].Trim();

                Response.Write(DisplayPageHeader());

                // Execute query
                QueryXML = "<Profiles Operation=\"GetPersonList\" Version=\"2\" xmlns=\"http://connects.profiles.schema/profiles/query\"><QueryDefinition><Name><LastName></LastName><FirstName></FirstName></Name><FacultyTypeList></FacultyTypeList><FacultyRankList></FacultyRankList><Affiliations><AffiliationList><Affiliation><InstitutionName></InstitutionName><DepartmentName></DepartmentName></Affiliation></AffiliationList></Affiliations><PersonFilterList></PersonFilterList><Keywords><KeywordString>" + cx(q) + "</KeywordString></Keywords></QueryDefinition><OutputOptions StartRecord=\"1\" MaxRecords=\"1\"></OutputOptions></Profiles>";
                dr = oDataIO.GetPersonList_xml(cs(QueryXML));
                if (dr.Read())
                {
                    strResult = dr[0].ToString();
                }

                if (!dr.IsClosed)
                    dr.Close();

                // Parse results
                strResult = strResult.Replace(" xmlns=\"http://connects.profiles.schema/profiles/personlist\"", "");

                XmlDocument objDocincomepreview = new XmlDocument();
                objDocincomepreview.LoadXml(strResult);
                ResultXML = objDocincomepreview.DocumentElement;
                QueryID = ResultXML.GetAttribute("QueryID");
                ResultCount = ResultXML.GetAttribute("TotalCount");

                Response.Write("<div style=\"width:260px;text-align:center;\"><b>");
                if (Convert.ToInt64(ResultCount) == 0)
                    Response.Write("no people were found");

                if (Convert.ToInt64(ResultCount) == 1)
                    Response.Write("one person was found");

                if (Convert.ToInt64(ResultCount) > 1)
                    Response.Write(ResultCount + " people were found");

                Response.Write("</b></div>");

                if (Convert.ToInt64(ResultCount) > 0)
                {
                    Response.Write("<div style=\"border-top:1px solid #999;width:260px;height:1px;overflow:hidden;margin:3px 0 3px 0;\"></div>");
                    Response.Write("<div style=\"width:290px;\">");
                    dr = oDataIO.GetFacultyRank(QueryID);
                    Int64 wz = 0;
                    while (dr.Read())
                    {
                        if (Convert.ToInt64(dr["n"]) > wz) wz = Convert.ToInt64(dr["n"]);
                    }

                    if(!dr.IsClosed)
                            dr.Close();

                    dr = oDataIO.GetFacultyRank(QueryID);

                    while (dr.Read())
                    {
                        Int64 w = 1 + Convert.ToInt64(100 * Convert.ToInt64(dr["n"]) / (wz * 1.000000));
                        Response.Write("<table cellpadding=\"0\" cellspacing=\"0\">");
                        Response.Write("<tr>");
                        Response.Write("<td style=\"width:120px; text-align:right; border-right:1px solid #000; padding-right:3px;\">" + dr["facultyrank"] + "</td>");
                        Response.Write("<td style=\"width:" + w.ToString() + "px; background-color:#900; \"></td>");
                        Response.Write("<td style=\"\">" + dr["n"] + "</td>");
                        Response.Write("<tr>");
                        Response.Write("</tr>");
                        Response.Write("</table>");
                    }

                    if (!dr.IsClosed)
                        dr.Close();

                }
                Response.Write("<div style=\"border-top:1px solid #999;width:260px;height:1px;overflow:hidden;margin:3px 0 3px 0;\"></div>");
                Response.Write("<div style=\"width:260px;text-align:center;font-size:10px;\">Powered by Harvard Catalyst Profiles</div>");
                Response.Write("</div>");
                Response.Write("</body>");
                Response.Write("</html>");
                break;

            /*
             * The "outgoingcount" case test will call all public systems that are involved in DIRECT
             * will receive one of our requests for what we have on
             */

            case "outgoingcount":

                if (Request["blank"] == "y")
                {
                    Response.Write("<html><body></body></html>");
                    Response.End();
                }

                string SearchPhrase = Request["SearchPhrase"];

                Response.Write("<script>parent.dsLoading=1;</script>" + Environment.NewLine);

                dr = oDataIO.GetSitesOrderBySiteID();

                SiteIDs = new int[1000];
                URLs = new string[1000];
                FSIDs = new string[1000];

                Site site;
                ListOfSites = new List<Site>();
                Int64 sites = 0;

                List<AsyncProcessing> ListOfThreads = new List<AsyncProcessing>();
                AsyncProcessing async;
                while (dr.Read())
                {
                    SiteIDs[sites] = Convert.ToInt32(dr["SiteID"].ToString());
                    URLs[sites] = dr["QueryURL"] + SearchPhrase;
                    FSIDs[sites] = dr["FSID"].ToString();
                    site = new Site(URLs[sites], SiteIDs[sites], FSIDs[sites], SearchPhrase, HttpContext.Current);
                    ListOfSites.Add(site);
                    async = new AsyncProcessing();
                    async.BeginProcessRequest(site);
                    ListOfThreads.Add(async);
                    sites++;
                }

                if (!dr.IsClosed)
                    dr.Close();

                //eat up the CPU for x number of seconds :) so all the requests can come back.  This is set in the web.config file
                DateTime end = DateTime.Now.AddSeconds(QueryTimeout);
                while (DateTime.Now < end)
                { }

                //close out anything that did not complete in 5 seconds
                for (int loop = 0; loop < ListOfThreads.Count; loop++)
                {

                    oDataIO = new DataIO();
                    sqlCmd = new SqlCommand();
                    sqlCmd.Connection = Conn;

                    if (!ListOfThreads[loop].Site.IsDone)
                    {
                        sql = "update FSLogOutgoing set ResponseTime = datediff(ms,SentDate,GetDate()), "
                                + " ResponseState = " + 1
                                + " where FSID = " + cs(ListOfThreads[loop].Site.FSID);

                        sqlCmd.CommandText = sql;
                        sqlCmd.CommandType = System.Data.CommandType.Text;
                        iResult = sqlCmd.ExecuteNonQuery();
                        Response.Write("<script>parent.siteResult(" + ListOfThreads[loop].Site.SiteID + ",1,0,'','','','');</script>");
                        ListOfThreads.Remove(ListOfThreads[loop]);
                    }
                }

                try
                {
                    Response.Flush();

                    if (Conn.State == System.Data.ConnectionState.Open)
                        Conn.Close();
                }
                catch { }

                break;
            case "outgoingdetails":

                string FSID = Request["fsid"].Trim();
                string SiteId = string.Empty;
                if (FSID != "")
                {
                    dr = oDataIO.GetFsID(cs(FSID));

                    if (dr.Read())
                    {
                        SiteId = dr["SiteID"].ToString();
                        ResultDetailsURL = dr["ResultDetailsURL"].ToString().Replace("\n\t", "");
                    }

                    if (!dr.IsClosed)
                        dr.Close();
                }
                if ((FSID != "") && (SiteId != "") && (ResultDetailsURL != ""))
                {
                    // Enter log record
                    sql = "insert into FSLogOutgoing(FSID,SiteID,Details,SentDate) "
                        + " values (" + cs(FSID) + "," + cs(SiteId) + ",1,GetDate())";
                    sqlCmd.CommandText = sql;
                    sqlCmd.CommandType = System.Data.CommandType.Text;
                    iResult = sqlCmd.ExecuteNonQuery();

                    if (sqlCmd.Connection.State == System.Data.ConnectionState.Open)
                        sqlCmd.Connection.Close();

                    Response.Redirect(ResultDetailsURL);

                }
                else
                    Response.Redirect(ProfilesURL);
                break;
        }

        Response.End();
    }
Example #33
0
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //reset working directory
            Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

            //set culture
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("en-US");

            var autoMapper  = new SimpleAutoMapper();
            var dataIO      = new DataIO();
            var messageBox  = new MessageBoxService();
            var mouseHook   = new MouseHook();
            var timerTool   = new TimerTool();
            var autoUpdater = new AutoUpdater(messageBox);
            var clipboard   = new ViewModelClipboard();
            var recent      = new RecentFileManager();
            var mtpManager  = new MTPManager();

            var DependencyDict = new Dictionary <Type, object>()
            {
                { typeof(SimpleAutoMapper), autoMapper },
                { typeof(MessageBoxService), messageBox },
                { typeof(ViewModelClipboard), clipboard },
            };

            var viewModelFactory = new ViewModelFactory(DependencyDict);

            (new ScriptGenerateBootstrap()).SetUp(out IActionToScriptFactory actionToScriptFactory, out IEmulatorToScriptFactory emulatorToScriptFactory);

            var settingVM           = new SettingViewModel(Settings.Default(), autoMapper, mtpManager);
            var macroManagerVM      = new MacroManagerViewModel(dataIO, messageBox, viewModelFactory, recent);
            var scriptApplyFactory  = new ScriptApplyBootStrap(messageBox, mtpManager).GetScriptApplyFactory();
            var scriptGenerator     = new ScriptGenerator(scriptApplyFactory, settingVM, messageBox, emulatorToScriptFactory, actionToScriptFactory);
            var scriptGeneratorVM   = new ScriptGeneratorViewModel(macroManagerVM, scriptGenerator, messageBox);
            var customActionManager = new CustomActionManager(macroManagerVM, viewModelFactory, dataIO, messageBox);

            var timerToolVM      = new TimerToolViewModel(mouseHook, timerTool);
            var resulutionTool   = new ResolutionConverterTool(viewModelFactory);
            var resolutionToolVM = new ResolutionConverterToolViewModel(resulutionTool, macroManagerVM, messageBox);
            var autoLocationVM   = new AutoLocationViewModel(new MouseHook(), new AutoLocation(), macroManagerVM);

            var mainWindowViewModel = new MainWindowViewModel(macroManagerVM, settingVM, autoUpdater, timerToolVM, resolutionToolVM, scriptGeneratorVM, customActionManager, autoLocationVM);

            MainWindow = new MainWindow
            {
                DataContext = mainWindowViewModel
            };

            //Handle arguments
            var agrs = Environment.GetCommandLineArgs();

            if (agrs.Length > 1)
            {
                var filepath = agrs.Where(s => s.Contains(".emm")).First();

                macroManagerVM.SetCurrentMacro(filepath, agrs.Any(s => s.Equals(StaticVariables.NO_SAVE_AGRS)));
            }

            // Select the text in a TextBox when it receives focus.
            EventManager.RegisterClassHandler(typeof(TextBox), TextBox.PreviewMouseLeftButtonDownEvent,
                                              new MouseButtonEventHandler(SelectivelyIgnoreMouseButton));
            EventManager.RegisterClassHandler(typeof(TextBox), TextBox.GotKeyboardFocusEvent,
                                              new RoutedEventHandler(SelectAllText));
            EventManager.RegisterClassHandler(typeof(TextBox), TextBox.MouseDoubleClickEvent,
                                              new RoutedEventHandler(SelectAllText));

            MainWindow.Show();
        }
Example #34
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string subject     = Request["subject"];
            string predicate   = Request["predicate"];
            string obj         = Request["object"];
            string person      = Request["person"];
            string expand      = Request["expand"];
            string showDetails = Request["showdetails"];
            string callback    = Request["callback"];

            Int64 nodeid = -1;

            if (subject != null && subject.Trim().Length > 0)
            {
                nodeid = Convert.ToInt64(subject);
            }
            else if (person != null && person.Trim().Length > 0)
            {
                nodeid = new DataIO().GetNodeId(Convert.ToInt32(person));
            }
            else
            {
                Response.Redirect(Profiles.Framework.Utilities.Root.Domain + "/ORNG/JSONLD/Test.htm");
            }

            Response.Clear();
            Response.Charset    = "charset=UTF-8";
            Response.StatusCode = Convert.ToInt16("200");

            string URL = Profiles.Framework.Utilities.Root.Domain + "/Profile/Profile.aspx?Subject=" + nodeid;

            if (predicate != null)
            {
                URL += "&Predicate=" + predicate;
            }
            if (obj != null)
            {
                URL += "&Object=" + obj;
            }
            if (expand != null)
            {
                URL += "&Expand=" + expand;
            }
            if (showDetails != null)
            {
                URL += "&ShowDetails=" + showDetails;
            }
            URL = ORNGSettings.getSettings().ShindigURL + "/rest/jsonld?userId=" + HttpUtility.UrlEncode(URL);

            HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(URL);

            myReq.Accept = "application/json"; // "application/ld+json";
            String jsonProfiles = new StreamReader(myReq.GetResponse().GetResponseStream()).ReadToEnd();

            //WebClient client = new WebClient();
            //String jsonProfiles = client.DownloadString(URL);

            if (callback != null && callback.Length > 0)
            {
                Response.ContentType = "application/javascript";
                Response.Write(callback + "(" + jsonProfiles + ");");
            }
            else
            {
                Response.ContentType = "application/json";
                Response.Write(jsonProfiles);
            }
        }
Example #35
0
    public void Save()
    {
        SoundData data = new SoundData(music.mute, music.volume);

        DataIO.Save <SoundData>("SoundSave", data);
    }
    public string DrawMyTable()
    {
        StringBuilder sb = new StringBuilder();
            StringBuilder jsAddSites = new StringBuilder();
            sb.Append(DrawListTableStart(6, 18, "Institution|Matches", "|", "|", "450|150", "l|c"));
            Int64 OddRow = 0;

            DataIO oDataIO = new DataIO();
            SqlDataReader dr = oDataIO.DirectResultset();

            while (dr.Read())
            {
                OddRow = 1 - OddRow;
                sb.Append(DrawListTableRow("doLocalPersonSearch('" + DirectServiceURL() + "'," + dr["SiteID"] + ");", "doSiteHoverOver(" + dr["SiteID"].ToString() + ");", "doSiteHoverOut(" + dr["SiteID"].ToString() + ");", OddRow,
                    dr["SiteName"].ToString() + "|" + "<div id='SITE_STATUS_" + dr["SiteID"].ToString() + "'><div class='siteresult' style='height:16px;'></div></div>",
                    "|",
                    "450|150",
                    "l|c"));
                jsAddSites.AppendLine("var t = {}; t.SiteID = " + dr["SiteID"] + "; t.ResultPopType = ''; t.ResultDetailsURL = ''; t.FSID = ''; fsObject.push(t);");
            }
            dr.Dispose();
            sb.Append(DrawListTableEnd());

            sb.Append("<script>");
            sb.Append(jsAddSites.ToString());
            sb.Append("</script>");

            return sb.ToString();
    }
Example #37
0
        public void LoadRDFData()
        {
            Framework.Utilities.DebugLogging.Log("{Page Calling} Profile.ProfileData.LoadRDFData() start " + ((System.Web.UI.TemplateControl)(this)).AppRelativeVirtualPath);
            XmlDocument xml = new XmlDocument();
            Namespace rdfnamespaces = new Namespace();
            DataIO data = new DataIO();

            //if (HttpContext.Current.Request.Headers["Offset"] != null)
            //    this.RDFTriple.Offset = HttpContext.Current.Request.Headers["Offset"];

            //if (HttpContext.Current.Request.Headers["Limit"] != null)
            //    this.RDFTriple.Limit = HttpContext.Current.Request.Headers["Limit"];

            //if (HttpContext.Current.Request.Headers["ExpandRDFList"] != null)
            //    this.RDFTriple.ExpandRDFList = HttpContext.Current.Request.Headers["ExpandRDFList"];

            xml = data.GetRDFData(this.RDFTriple);
            this.RDFData = xml;
            this.RDFNamespaces = rdfnamespaces.LoadNamespaces(xml);
            Framework.Utilities.DebugLogging.Log("{Page Calling} Profile.ProfileData.LoadRDFData() end" + ((System.Web.UI.TemplateControl)(this)).AppRelativeVirtualPath);
        }
Example #38
0
 public void SetupTest()
 {
     dataIO = new DataIO();
 }
Example #39
0
    public void Save()
    {
        PlayerData data = new PlayerData(coins, grassChapterPassed, mistChapterPassed);

        DataIO.Save <PlayerData>("PlayerSave", data);
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     DataIO data = new DataIO();
     Response.Write(data.GetEditedCount());
 }