コード例 #1
0
ファイル: cp_Maplewood.aspx.cs プロジェクト: nehawadhwa/ccweb
        protected void btnCourses_Click(object sender, EventArgs e)
        {
            com.maplewood.www.mwWebSrvStAc Integration = new com.maplewood.www.mwWebSrvStAc();
            Integration.Url = GetWebServiceURL();
            Integration.Timeout = 360000;

            //Loop thru Sudbury Schools
            string strSQL = "SELECT cpSchoolCode, SchoolId, InstitutionName FROM UserInfo WHERE cpSystemNameId = " + GetSystemNameId() + " order by institutionType, schoolid";
            DataTable dtb = DataAccess.GetDataTable(strSQL);

            foreach (DataRow dr in dtb.Rows)
            {
                Response.Write("--------------------------------------<br/>");
                Response.Write(dr["cpSchoolCode"].ToString() + ":" + dr["InstitutionName"].ToString() + "<br/>");
                Response.Write("--------------------------------------<br/>");

                //Student Courses in Progress
                //--------------------------
                com.maplewood.www.StAc_Course objMWCourses = new com.maplewood.www.StAc_Course();
                objMWCourses = Integration.GetCoursesSched(dr["cpSchoolCode"].ToString());
                Response.Write("Course Sch for: " + objMWCourses.Course_Details.Count.ToString() + "<br/>");

                SqlBulkCopy oBulkInProgress = new SqlBulkCopy(strCareerdbImportLocal);
                oBulkInProgress.DestinationTableName = "MWCourses";
                oBulkInProgress.WriteToServer(objMWCourses.Course_Details);
                oBulkInProgress.Close();
                //--------------------------
            }
        }
コード例 #2
0
ファイル: Maplewood.aspx.cs プロジェクト: nehawadhwa/ccweb
        protected void btnScheduledCourses_Click(object sender, EventArgs e)
        {
            com.maplewood.www.mwWebSrvStAc Integration = new com.maplewood.www.mwWebSrvStAc();
            Integration.Url = strWebServiceURL;
            Integration.Timeout = 60000000;

            lblResultText.Text = btnCourses.Text.ToString();

            foreach (ListItem itm in chkSchools.Items)
            {
                if (itm.Selected)
                {
                    //Student Courses in Progress
                    //--------------------------
                    dtmTimeBefore = DateTime.Now;
                    com.maplewood.www.StAc_Course objMWCourses = new com.maplewood.www.StAc_Course();
                    objMWCourses = Integration.GetCoursesSched(itm.Value.ToString());
                    dtmTimeAfter = DateTime.Now;
                    timDuration = (TimeSpan)dtmTimeAfter.Subtract(dtmTimeBefore);

                    dtmTimeBefore = DateTime.Now;
                    if (objMWCourses.Course_Details.Count > 0)
                    {
                        strResults.Append(timDuration.Minutes.ToString() + ":" + timDuration.Seconds.ToString() + " - " +
                            objMWCourses.Course_Details.Count.ToString() + " : " + itm.Value.ToString() + ":" + itm.Text.ToString() + " -  ");
                    }

                    SqlBulkCopy oBulkInProgress = new SqlBulkCopy(strCareerdbImportLocal);
                    oBulkInProgress.DestinationTableName = "MWCourses";
                    oBulkInProgress.WriteToServer(objMWCourses.Course_Details);
                    oBulkInProgress.Close();
                    dtmTimeAfter = DateTime.Now;
                    timDuration = (TimeSpan)dtmTimeAfter.Subtract(dtmTimeBefore);
                    strResults.Append(" - " + timDuration.Minutes.ToString() + ":" + timDuration.Seconds.ToString() + "\r\n");
                    strResults.Append("--------------------------------------\r\n");
                    //--------------------------
                }
            }

            txtResults.Text = strResults.ToString();
        }