private int CountWatch(AdobeConnectDTO AdobeConnectDTO) { AdobeBusiness adobeBuisnes = new AdobeBusiness(); XmlDocument doc = new XmlDocument(); doc = adobeBuisnes.GetMyMeeting(AdobeConnectDTO); int count = 0; if (doc != null) { if (doc.OuterXml.ToString().Contains("meeting")) { XmlNodeList nodeList = doc.SelectNodes("//results/my-meetings/meeting"); foreach (XmlNode no in nodeList) { bool bTime = CheckTimeDefence(AdobeConnectDTO, AdobeConnectDTO.UserLogin, no.Attributes["sco-id"].Value.ToString()); if (bTime == true) { ++count; } } } } return(count); }
public static DataTable GetMyMeetingDefence(AdobeConnectDTO adobeConnectDTO, string typeCollege = "") { DataTable dt = new DataTable(); XmlDocument doc = new XmlDocument(); AdobeBusiness adobeBusiness = new AdobeBusiness(); adobeBusiness.LoginAsUser(adobeConnectDTO); doc = adobeBusiness.GetMyMeeting(adobeConnectDTO); dt.Columns.Add("MeetingId"); dt.Columns.Add("Name"); dt.Columns.Add("DateStart"); dt.Columns.Add("DateEnd"); dt.Columns.Add("MeetingUrl"); DataRow dr; if (doc.OuterXml.ToString().Contains("sco")) { XmlNodeList nodeList = doc.SelectNodes("//results/my-meetings/meeting"); foreach (XmlNode no in nodeList) { if (typeCollege == "" || no["Name"].ToString().Contains(typeCollege)) { dr = dt.NewRow(); dr["MeetingId"] = no.Attributes["sco-id"].Value; dr["Name"] = no["name"].InnerText.ToString(); dr["DateStart"] = no["date-begin"].InnerText; dr["DateEnd"] = no["date-end"].InnerText; dr["MeetingUrl"] = no["url-path"].InnerText; dt.Rows.Add(dr); } } } return(dt); }
public AdobeConnectDTO LoginAsUser(AdobeConnectDTO AdobeConnectDTO) { string serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=login" + "&login="******"&password=" + AdobeConnectDTO.UserPassWord; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); request.CookieContainer = new CookieContainer(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Cookie Cookies = new System.Net.Cookie(); foreach (Cookie cook in response.Cookies) { Cookies.Value = cook.Value; Cookies.Name = cook.Name; Cookies.Domain = cook.Domain; Cookies.Path = cook.Path; Cookies.Port = cook.Port; Cookies.Secure = cook.Secure; Cookies.Expires = cook.Expires; Cookies.Expired = cook.Expired; Cookies.Discard = cook.Discard; Cookies.Comment = cook.Comment; Cookies.CommentUri = cook.CommentUri; Cookies.Version = cook.Version; } AdobeConnectDTO.DomainCookies = Cookies; return(AdobeConnectDTO); }
public void DeleteMeeting(AdobeConnectDTO adobeConnectDTO) { AdobeBusiness adobeBuisnes = new AdobeBusiness(); adobeConnectDTO = adobeBuisnes.LoginAsAdmin(adobeConnectDTO); adobeBuisnes.DeleteMeetingByScoID(adobeConnectDTO); adobeBuisnes.Logout(adobeConnectDTO); }
public void CreateMeeting(AdobeConnectDTO adobeConnectDTO) { AdobeBusiness adobeBuisnes = new AdobeBusiness(); adobeConnectDTO = adobeBuisnes.LoginAsAdmin(adobeConnectDTO); adobeBuisnes.CreateNewMeeting(adobeConnectDTO); adobeConnectDTO = adobeBuisnes.Logout(adobeConnectDTO); }
public XmlDocument GetMeetings(AdobeConnectDTO AdobeConnectDTO) { XmlDocument doc = new XmlDocument(); string serviceUrl; serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=sco-contents&sco-id=" + scoId + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); doc.LoadXml(GetWebPageAsString(serviceUrl)); return(doc); }
public void DeleteMeetingByScoID(AdobeConnectDTO adobeConnectDTO) { string serviceUrl; serviceUrl = "http://" + adobeConnectDTO.DomainAddress + "/api/xml?action=sco-delete&sco-id=" + GetScoidMeeting(adobeConnectDTO) + "&session=" + adobeConnectDTO.DomainCookies.Value.Trim(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); }
public XmlDocument GetMyMeeting(AdobeConnectDTO AdobeConnectDTO) {//login for current user XmlDocument doc = new XmlDocument(); string serviceUrl; serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=report-my-meetings" + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); doc.LoadXml(GetWebPageAsString(serviceUrl)); return(doc); }
public AdobeConnectDTO SetUserinMeetingAsPresenter(AdobeConnectDTO AdobeConnectDTO) { string serviceUrl; serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=permissions-update&acl-id=" + GetScoidMeeting(AdobeConnectDTO) + "&principal-id=" + AdobeConnectDTO.PrincipalID + "&permission-id=mini-host&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); return(AdobeConnectDTO); }
public AdobeConnectDTO Logout(AdobeConnectDTO AdobeConnectDTO) { string serviceUrl; serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=logout" + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); AdobeConnectDTO.DomainCookies = null; return(AdobeConnectDTO); }
public XmlDocument GetReportuserMeetings(AdobeConnectDTO AdobeConnectDTO, string scoidMeeting, string loginId = "") { XmlDocument doc = new XmlDocument(); string serviceUrl; serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=report-meeting-attendance" + "&sco-id=" + scoidMeeting + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); if (loginId.Trim() != "") { serviceUrl += "&filter-login=" + loginId; } doc.LoadXml(GetWebPageAsString(serviceUrl)); return(doc); }
public string CreateNewUser(AdobeConnectDTO AdobeConnectDTO) { string serviceUrl = "http://" + AdobeConnectDTO.DomainAddress.Trim() + "/api/xml?action=principal-update" + "&first-name=" + AdobeConnectDTO.UserFirstName.Trim() + "&last-name=" + AdobeConnectDTO.UserLastName.Trim() + "&has-children=0" + "&login="******"&password=4sx0pvauo4nleowu5ugvkkx9l0bpsbe" + "&type=user" + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); return(GetPrincipalId(AdobeConnectDTO)); }
private AdobeConnectDTO Login(AdobeConnectDTO AdobeConnectDto) { AdobeConnectDTO ACDTO = new DTO.AdobeClasses.AdobeConnectDTO(); ACDTO.DomainAddress = "kadobe.iauec.ac.ir"; ACDTO.DomainLogin = "******"; ACDTO.DomainPassword = "******"; ACDTO.FolderName = AdobeConnectDto.FolderName; ACDTO.FolderFolderId = AdobeConnectDto.FolderFolderId; ACDTO.FolderUrlPath = "Apps" + AdobeConnectDto.FolderUrlPath; ACDTO.FolderDataBegin = new DateTime(2015, 01, 01); ACDTO.FolderDataEnd = new DateTime(2016, 12, 28); return(ACDTO); }
public string OpenMeetingAsHost(AdobeConnectDTO adobeConnectDTO) { adobeConnectDTO = LoginAsAdmin(adobeConnectDTO); string principalstr = GetPrincipalId(adobeConnectDTO); if (principalstr == "") { CreateNewUser(adobeConnectDTO); principalstr = GetPrincipalId(adobeConnectDTO); } adobeConnectDTO.PrincipalID = principalstr; SetUserinMeetingAsHost(adobeConnectDTO); Logout(adobeConnectDTO); adobeConnectDTO = LoginAsUser(adobeConnectDTO); return(OpenMeetingForDefence(adobeConnectDTO.MeetingUrlPath, "view", adobeConnectDTO.DomainCookies.Value.Trim(), adobeConnectDTO.DomainAddress)); }
public string GetPrincipalId(AdobeConnectDTO AdobeConnectDTO) { string principalid; XmlDocument doc = new XmlDocument(); string serviceUrl = "http://" + AdobeConnectDTO.DomainAddress.Trim() + "/api/xml?action=principal-list" + "&filter-Login="******"&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); doc.LoadXml(GetWebPageAsString(serviceUrl)); principalid = ""; if (doc.OuterXml.ToString().Contains("principal-id")) { principalid = doc.SelectSingleNode("//results/principal-list/principal/@principal-id").Value; } return(principalid); }
public string GetScoidMeeting(AdobeConnectDTO AdobeConnectDTO) { XmlDocument doc = new XmlDocument(); string serviceUrl; serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=sco-contents&sco-id=" + scoId + "&filter-type=meeting" + "&filter-url-path=" + AdobeConnectDTO.MeetingUrlPath + "/" + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); doc.LoadXml(GetWebPageAsString(serviceUrl)); if (doc.OuterXml.ToString().Contains("sco-id")) { return(doc.SelectSingleNode("//results/scos/sco/@sco-id").Value); } return(""); }
public static void CreateMeeting(string stCode, string date, string startTime, int LengthMeeting, string stName, bool flagTotal = false, string requestId = "") { RequestHandler reqH = new RequestHandler(); AdobeConnectDTO adobeConnectDTO = new AdobeConnectDTO(); LoginBusiness lgb = new LoginBusiness(); AdobeDefenceBusiness adobeDefenceBusiness = new AdobeDefenceBusiness(); LoginDTO stInfo = lgb.Get_StInfo(stCode.ToString()); const string pass = "******"; string firtsName = (stInfo == null || stInfo.Name == null || stInfo.Name.Trim() == "") ? "نامشخص" : stInfo.Name; string lastName = (stInfo == null || stInfo.LastName == null || stInfo.LastName.Trim() == "") ? "نامشخص" : stInfo.LastName; adobeConnectDTO.SetValueDefult(stCode.ToString(), pass, firtsName, lastName); adobeConnectDTO.MeetingName = ConvertorFarsi2Arabic.Parse_Farsi2_Arabic(" جلسه دفاع " + (stName != null && stName.Trim() != "" ? stName : "")); string link = adobeDefenceBusiness.CreateLinkMeeting(stCode.ToString(), date, startTime.ToString()); adobeConnectDTO.MeetingUrlPath = link; PersianCalendar PC = new PersianCalendar(); adobeConnectDTO.MeetingDataBegin = PC.ToDateTime(int.Parse(date.Substring(0, 4)), int.Parse(date.Substring(5, 2)), int.Parse(date.Substring(8, 2)), int.Parse(startTime), 0, 0, 0); adobeConnectDTO.MeetingDataEnd = PC.ToDateTime(int.Parse(date.Substring(0, 4)), int.Parse(date.Substring(5, 2)), int.Parse(date.Substring(8, 2)), int.Parse(startTime) + LengthMeeting, 0, 0, 0); if (flagTotal) { adobeDefenceBusiness.CreateMeeting(adobeConnectDTO); } else { DataTable dtExistLink = reqH.GetMeetingDefencesAStudentByStcodeBusinesss(stCode.ToString()); if (dtExistLink != null && dtExistLink.Rows.Count > 0 && dtExistLink.Rows[0]["resLink"].ToString().Trim() != "") { //empty } else { adobeDefenceBusiness.CreateMeeting(adobeConnectDTO); reqH.UpdateRequest_LinkMeeting(requestId.Trim(), link); } } }
public DataTable MeetingPresentedSt(AdobeConnectDTO adobeConnectDTO) { //domain DataTable dtMyMeeting = GetMyMeetingDefence(adobeConnectDTO); DataTable dt = new DataTable(); RequestHandler requestHandler = new RequestHandler(); const int startindex = 3; const int Length = 9; dt.Columns.Add("Id", typeof(System.String)); dt.Columns.Add("StudentCode", typeof(System.String)); dt.Columns.Add("StudentFullName", typeof(System.String)); dt.Columns.Add("DefenceSubject", typeof(System.String)); dt.Columns.Add("LocName", typeof(System.String)); dt.Columns.Add("nameresh", typeof(System.String)); dt.Columns.Add("startTime", typeof(System.String)); dt.Columns.Add("Count", typeof(System.String)); foreach (DataRow row in dtMyMeeting.Rows) { DataTable dtMeetingDefence; string stCode = row["MeetingUrl"].ToString().Substring(startindex, Length); dtMeetingDefence = requestHandler.GetMeetingDefencesAStudentByStcodeBusinesss(stCode, "-1"); string countTimeDefence = CountTimeDefence(adobeConnectDTO, adobeConnectDTO.UserLogin, row["MeetingId"].ToString()); if (countTimeDefence != "" && dt != null && dtMeetingDefence.Rows.Count > 0) { DataRow dr = dt.NewRow(); dr["Id"] = dtMeetingDefence.Rows[0]["Id"]; dr["StudentCode"] = dtMeetingDefence.Rows[0]["StudentCode"]; dr["StudentFullName"] = dtMeetingDefence.Rows[0]["StudentFullName"]; dr["DefenceSubject"] = dtMeetingDefence.Rows[0]["DefenceSubject"]; dr["LocName"] = dtMeetingDefence.Rows[0]["LocName"]; dr["nameresh"] = dtMeetingDefence.Rows[0]["nameresh"]; dr["startTime"] = dtMeetingDefence.Rows[0]["startTime"]; dr["Count"] = countTimeDefence; dt.Rows.Add(dr); } } return(dt); }
public bool CheckAcceptRequestDefence(AdobeConnectDTO adobeConnectDTO) { const int standardCount = 3; AdobeBusiness adobeBuisnes = new AdobeBusiness(); adobeConnectDTO = adobeBuisnes.LoginAsAdmin(adobeConnectDTO); adobeConnectDTO.PrincipalID = adobeBuisnes.GetPrincipalId(adobeConnectDTO); adobeBuisnes.Logout(adobeConnectDTO); adobeConnectDTO = adobeBuisnes.LoginAsUser(adobeConnectDTO); int count = CountWatch(adobeConnectDTO); adobeBuisnes.Logout(adobeConnectDTO); if (count >= standardCount) { return(true); } else { return(false); } }
public string GetCheckLogin(AdobeConnectDTO AdobeConnectDTO) { string Text = "False"; string serviceUrl = "http://" + AdobeConnectDTO.DomainAddress + "/api/xml?action=common-info" + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); XmlReader reader = XmlReader.Create(response.GetResponseStream()); while (reader.Read()) { reader.MoveToFirstAttribute(); if (reader.NodeType == XmlNodeType.Text && AdobeConnectDTO.DomainLogin == reader.Value) { Text = "ok"; } } return(Text); }
public static bool CreateAllMeetingNotExist() { AdobeConnectDTO adobeConnectDTO = new AdobeConnectDTO(); adobeConnectDTO.SetValueDefult(); RequestHandler _requestHandler = new RequestHandler(); DataTable dtMeetingsOnlineDb; dtMeetingsOnlineDb = _requestHandler.GetMeetingTotalDefencesbyCollegeIdBusiness(); DataTable dtMeetingsAdobe; dtMeetingsAdobe = GetMeetingsDefence(adobeConnectDTO); foreach (DataRow rowDb in dtMeetingsOnlineDb.Rows) { if (rowDb["resLink"].ToString().Trim().ToLower().Trim('/') != "") { bool flagExist = false; foreach (DataRow rowAdobe in dtMeetingsAdobe.Rows) { if (rowDb["resLink"].ToString().Trim().ToLower().Trim('/') == rowAdobe["MeetingUrl"].ToString().Trim().ToLower().Trim('/')) { flagExist = true; break; } } if (flagExist == false) { CreateMeeting(rowDb["studentcode"].ToString(), rowDb["RequestDate"].ToString(), rowDb["startTime"].ToString().Substring(0, 2), 1, rowDb["StudentFullName"].ToString(), true); } } } return(true); }
private bool CheckTimeDefence(AdobeConnectDTO AdobeConnectDTO, string loginId, string scoidMeeting) { const int standardLengthTime = 20; XmlDocument doc = new XmlDocument(); AdobeBusiness adobeBuisnes = new AdobeBusiness(); AdobeConnectDTO adobeConnectDTO1 = new AdobeConnectDTO(); adobeConnectDTO1.DomainAddress = AdobeConnectDTO.DomainAddress; adobeConnectDTO1.DomainLogin = AdobeConnectDTO.DomainLogin; adobeConnectDTO1.DomainPassword = AdobeConnectDTO.DomainPassword; adobeConnectDTO1 = adobeBuisnes.LoginAsAdmin(adobeConnectDTO1); doc = adobeBuisnes.GetReportuserMeetings(adobeConnectDTO1, scoidMeeting, loginId); adobeBuisnes.Logout(adobeConnectDTO1); if (doc != null) { if (doc.OuterXml.ToString().Contains("row")) { XmlNodeList nodeList = doc.SelectNodes("//results/report-meeting-attendance/row"); DateTime startDate; DateTime endDate; TimeSpan lengthTime = TimeSpan.Zero; foreach (XmlNode no in nodeList) { startDate = Convert.ToDateTime(no["date-created"].InnerText); endDate = Convert.ToDateTime(no["date-end"].InnerText); lengthTime += (endDate - startDate); if (lengthTime.TotalMinutes > standardLengthTime) { return(true); } } } } return(false); }
//Insert #region Create /// <summary> /// Create Folder: /// Here, Because used Handy URL, Need To Combination Chars & Numbers to Able /// To Create /// </summary> /// <param name="Cookie"></param> /// <returns></returns> public bool CreateFolder(AdobeConnectDTO ACDTO) { ACDTO = Login(ACDTO); bool Resualt = false; string serviceUrl = "http://" + ACDTO.DomainAddress + "/api/xml?action=sco-update&type=folder" + "&name=" + ACDTO.FolderName + "&folder-id=" + ACDTO.FolderFolderId + "&date-begin=" + ACDTO.FolderDataBegin.Year.ToString() + "-" + ACDTO.FolderDataBegin.Month.ToString() + "-" + ACDTO.FolderDataBegin.Day.ToString() + "&date-end=" + ACDTO.FolderDataEnd.Year.ToString() + "-" + ACDTO.FolderDataEnd.Month.ToString() + "-" + ACDTO.FolderDataEnd.Day.ToString() + "&url-path=" + ACDTO.FolderUrlPath + "&session=" + ACDTO.DomainCookies.Value; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); request.CookieContainer = new CookieContainer(); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); XmlReader reader = XmlReader.Create(response.GetResponseStream()); XmlNodeType z; while (reader.Read()) { reader.MoveToFirstAttribute(); z = reader.NodeType; if (reader.Value == "ok") { Resualt = true; } } return(Resualt); }
public AdobeConnectDTO CreateNewMeeting(AdobeConnectDTO AdobeConnectDTO) { XmlDocument doc = new XmlDocument(); string serviceUrl = "http://" + AdobeConnectDTO.DomainAddress.Trim() + "/api/xml?action=sco-update" + "&type=meeting&name=" + AdobeConnectDTO.MeetingName.Trim() + AdobeConnectDTO.UserLogin.Trim() + "&folder-id=" + scoId + "&date-begin=" + AdobeConnectDTO.MeetingDataBegin.Year + "-" + (AdobeConnectDTO.MeetingDataBegin.Month.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataBegin.Month.ToString() : AdobeConnectDTO.MeetingDataBegin.Month.ToString()) + "-" + (AdobeConnectDTO.MeetingDataBegin.Day.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataBegin.Day.ToString() : AdobeConnectDTO.MeetingDataBegin.Day.ToString()) + "T" + (AdobeConnectDTO.MeetingDataBegin.Hour.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataBegin.Hour.ToString() : AdobeConnectDTO.MeetingDataBegin.Hour.ToString()) + ":" + (AdobeConnectDTO.MeetingDataBegin.Minute.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataBegin.Minute.ToString() : AdobeConnectDTO.MeetingDataBegin.Minute.ToString()) + "&date-end=" + AdobeConnectDTO.MeetingDataEnd.Year + "-" + (AdobeConnectDTO.MeetingDataEnd.Month.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataEnd.Month.ToString() : AdobeConnectDTO.MeetingDataEnd.Month.ToString()) + "-" + (AdobeConnectDTO.MeetingDataEnd.Day.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataEnd.Day.ToString() : AdobeConnectDTO.MeetingDataEnd.Day.ToString()) + "T" + (AdobeConnectDTO.MeetingDataEnd.Hour.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataEnd.Hour.ToString() : AdobeConnectDTO.MeetingDataEnd.Hour.ToString()) + ":" + (AdobeConnectDTO.MeetingDataEnd.Minute.ToString().Length < 2 ? "0" + AdobeConnectDTO.MeetingDataEnd.Minute.ToString() : AdobeConnectDTO.MeetingDataEnd.Minute.ToString()) + "&url-path=" + (AdobeConnectDTO.MeetingUrlPath.Replace("/", "")).Trim() + "&session=" + AdobeConnectDTO.DomainCookies.Value.Trim(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(serviceUrl); HttpWebResponse response = (HttpWebResponse)request.GetResponse(); return(AdobeConnectDTO); }