public List <UserNameGetWebSite> GetInfrmationofdateGet() { if (!Login) { throw new MemberAccessException("لم يتم تسجيل الدخول"); } List <UserNameGetWebSite> UserNameGetWebSite = new List <UserNameGetWebSite>(); #region GetString string Like = string.Format("{0}/{1}{2}" , DomenName , EnumLink.GetAllUserInformation , EnumLink.AtuTction(this.UserName, this.Password) ); try { string Get = System.Text.Encoding.UTF8.GetString(WebClient.DownloadData(Like)); string[] temS = Get.Split(';'); foreach (string item in temS) { string[] temAll = item.Split(','); UserNameGetWebSite.Add(new UserNameGetWebSite(Convert.ToInt32(temAll[0]), Convert.ToString(temAll[1]), Convert.ToString(temAll[2]), Convert.ToString(temAll[3]))); } } catch { } #endregion return(UserNameGetWebSite); }
public void ENDASSINGSHOW(int idAssingPHPid) { string Like = string.Format("{0}/{1}{2}&{3}={4}" , DomenName, "EndAssetAfterGet.php", EnumLink.AtuTction(this.UserName, this.Password), "IdOfassessvitelEnd", idAssingPHPid ); try { string st = System.Text.Encoding.UTF8.GetString(WebClient.DownloadData(Like)); } catch (WebException WebExceptionc) { throw WebExceptionc; } }
public bool LoginSet(bool Sinlnt = false) { string Like = string.Format("{0}/{1}{2}" , DomenName, EnumLink.ChkUserAndPassAndVerin, EnumLink.AtuTction(this.UserName, this.Password) ); try { string st = System.Text.Encoding.UTF8.GetString(WebClient.DownloadData(Like)); Id = Convert.ToInt32(st.Trim()); if (Id > 0) { Login = true; return(true); } else if (Id == -1) { if (!Sinlnt) { throw new IndexOutOfRangeException("النسخة قديمة.. الرجاء تحديث"); } } } catch (WebException WebExceptionc) { Login = false; if (!Sinlnt) { throw WebExceptionc; } } Login = false; if (!Sinlnt) { throw new IndexOutOfRangeException("كلمة السر أو أسم المستخدم خطأ"); } return(false); }
public List <vitelAssingInformation> GetAllDataByidVitl(int infox) { if (!Login) { throw new MemberAccessException("لم يتم تسجيل الدخول"); } List <vitelAssingInformation> vitelAssingInformation1 = new List <vitelAssingInformation>(); #region vitelAssingInformation1 string Like = string.Format("{0}/{1}{2}{3}" , DomenName , EnumLink.GetTeamNameVitelbyid , EnumLink.AtuTction(this.UserName, this.Password) , "&IdVitl=" + infox.ToString() ); WebClient client = new WebClient(); string tringofdataid = System.Text.Encoding.UTF8.GetString(client.DownloadData(Like)); XDocument fe = XDocument.Parse(tringofdataid.Remove(0, 1)); #endregion List <int> qustionId = new List <int>(); XElement elementx = fe.Root.Element("QustionId"); XElement elIdForm = fe.Root.Element("IdForm"); IEnumerable <XElement> feef = elementx.Elements(); foreach (XElement item in feef) { qustionId.Add(Convert.ToInt32(item.Value)); } List <int> idinformation = new List <int>(); XElement Allname = fe.Root.Element("AllNameId"); IEnumerable <XElement> Allnameout = Allname.Elements(); foreach (XElement item in Allnameout) { idinformation.Add(Convert.ToInt32(item.Value)); } List <List <int> > restut = new List <List <int> >(); XElement Allreslt = fe.Root.Element("AllAnsser"); IEnumerable <XElement> Allresltin1 = Allreslt.Elements(); foreach (XElement item in Allresltin1) { IEnumerable <XElement> Resutone = item.Elements(); List <int> oneReslut = new List <int>(); foreach (XElement Res in Resutone) { oneReslut.Add(Convert.ToInt32(Res.Value)); } restut.Add(oneReslut); } for (int i = 0; i < restut.Count; i++) { vitelAssingInformation1.Add(new vitelAssingInformation(qustionId, restut[i], idinformation[i], Convert.ToInt32(elIdForm.Value))); } return(vitelAssingInformation1); }
public XDocument GetXmlFile(EnumGetXML Enum) { if (!Login) { throw new MemberAccessException("لم يتم تسجيل الدخول"); } XDocument doc = null; if (Enum == EnumGetXML.GetXMLTheAssessVitel) { string Like = string.Format("{0}/{1}{2}&id={3}" , DomenName , EnumLink.GetNameForAssessVitel , EnumLink.AtuTction(this.UserName, this.Password) , this.Id ); string Get = System.Text.Encoding.UTF8.GetString(WebClient.DownloadData(Like)); int f = 0; try { f = Convert.ToInt32(Get); } catch { } if (f == -1) { throw new MemberAccessException("لا يوجد متطوعين للتقيم"); } try { doc = XDocument.Parse(Get.Trim()); } catch (Exception e) { throw e; } return(doc); } else if (Enum == EnumGetXML.GetXMLTheNameTeam) { string Like = string.Format("{0}/{1}{2}&id={3}" , DomenName , EnumLink.GetNameTeamVitel , EnumLink.AtuTction(this.UserName, this.Password) , this.Id ); doc = XDocument.Load(Like); return(doc); } return(doc); }