Ejemplo n.º 1
0
 public void UpdateAccountInfo(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     if (parameters.ContainsKey ("token_id") && !string.IsNullOrEmpty (parameters ["token_id"])) {
         string getaccountinfo = String.Format (URLManager.UpdateAccountInfo + "?token_id={0}",  parameters ["token_id"]);
         parameters.Remove ("token_id");
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (getaccountinfo);
         webrequest.parameters = parameters;
         webrequest.verb = HTTPVerb.POST;
         LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
         thread.Start ();
     }else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 2
0
        public void RequestTempPass(Dictionary<string,string> parameters, MsgHandler responsehander)
        {
            if (parameters.ContainsKey ("token_id")&&parameters.ContainsKey ("email")&&parameters.ContainsKey ("ORGANIZATION_ID") &&!string.IsNullOrEmpty (parameters ["token_id"]) &&!string.IsNullOrEmpty (parameters ["email"])&&!string.IsNullOrEmpty (parameters ["ORGANIZATION_ID"]) ) {
                string requesttemppass = String.Format (URLManager.RequestTempPass + "?token_id={0}",  parameters ["token_id"]);
                Tap5050WebRequest webrequest = new Tap5050WebRequest ();
                Dictionary<string,string> tempparameters =new Dictionary<string, string>();
                tempparameters.Add("email",parameters["email"]);
                tempparameters.Add ("ORGANIZATION_ID",parameters["ORGANIZATION_ID"]);

                webrequest.parameters = tempparameters;
                webrequest.SetURL (requesttemppass);
                webrequest.verb = HTTPVerb.POST;
                LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
                thread.Start ();
            }else {
                if(responsehander!=null){
                    Tap5050WebResponse response = new Tap5050WebResponse ();
                    response.available = false;
                    response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
                    responsehander(response);
                }
            }
        }
Ejemplo n.º 3
0
 /**
  * @parameters email
  **/
 public void RestPassword(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     Tap5050WebRequest webrequest =new Tap5050WebRequest();
     webrequest.SetURL(URLManager.RestPassword);
     webrequest.parameters = parameters;
     webrequest.verb = HTTPVerb.POST;
     LoadContentThread thread = new LoadContentThread(webrequest, responsehander);
     thread.Start();
 }
Ejemplo n.º 4
0
 //load different image with differnt type, somethimes there may have many image to load with same position.
 //types in
 public void LoadImage(Tap5050ImageFlag imageflag,MsgHandler responsehander)
 {
     if (!string.IsNullOrEmpty(imageflag.url)) {
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (imageflag.url);
         webrequest.verb = HTTPVerb.GET;
         LoadContentThread thread = new LoadContentThread (webrequest,imageflag,responsehander);
         thread.Start ();
     }else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 5
0
 //need organization_id
 public void PostRelationship(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     if (parameters.ContainsKey ("token_id") && parameters.ContainsKey ("location")&&parameters.ContainsKey ("ORGANIZATION_ID") && !string.IsNullOrEmpty (parameters ["token_id"]) && !string.IsNullOrEmpty (parameters ["location"])&& !string.IsNullOrEmpty (parameters ["ORGANIZATION_ID"])) {
         string fulurl = String.Format (URLManager.Relationship+"?token_id={0}&location={1}", parameters ["token_id"], parameters ["location"]);
         parameters.Remove ("token_id");
         parameters.Remove ("location");
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (fulurl);
         webrequest.parameters = parameters;
         webrequest.verb = HTTPVerb.POST;
         LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
         thread.Start ();
     }else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 6
0
 //get location when initialize Homescreen
 public void GetLocationfromGEO(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     if (parameters.ContainsKey ("lat") && parameters.ContainsKey ("lng")&&parameters.ContainsKey ("username") && !string.IsNullOrEmpty (parameters ["lat"]) && !string.IsNullOrEmpty (parameters ["lng"])&& !string.IsNullOrEmpty (parameters ["username"])) {
         string fulurl = String.Format (URLManager.BaseLocationURL+"?lat={0}&lng={1}&username={2}", parameters ["lat"], parameters ["lng"], parameters ["username"]);
         parameters.Remove ("lat");
         parameters.Remove ("lng");
         parameters.Remove ("username");
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (fulurl);
         webrequest.parameters = parameters;
         webrequest.verb = HTTPVerb.GET;
         LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
         thread.Start ();
     }else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 7
0
 public void GetStateAndProvince(MsgHandler responsehander)
 {
     Tap5050WebRequest webrequest =new Tap5050WebRequest();
     webrequest.SetURL(URLManager.StateAndProvince);
     webrequest.verb = HTTPVerb.GET;
     LoadContentThread thread = new LoadContentThread(webrequest, responsehander);
     thread.Start();
 }
Ejemplo n.º 8
0
 /**
  * @return indicate if successfully construct URL
  **/
 public void GetEvents(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     if (parameters.ContainsKey ("location") && parameters.ContainsKey ("token_id") && !string.IsNullOrEmpty (parameters ["token_id"]) && !string.IsNullOrEmpty (parameters ["location"])) {
         var url = String.Format (URLManager.Events + "?location={0}&token_id={1}", parameters ["location"], parameters ["token_id"]);
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (url);
         webrequest.verb = HTTPVerb.GET;
         LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
         thread.Start ();
     } else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 9
0
 public void CheckUserByPhone(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     if (parameters.ContainsKey ("mphone") && parameters.ContainsKey ("token_id") && !string.IsNullOrEmpty (parameters ["token_id"]) && !string.IsNullOrEmpty (parameters ["mphone"])) {
         string checkuser = String.Format (URLManager.CheckUser + "?token_id={0}&mphone={1}", parameters ["token_id"], parameters ["mphone"]);
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (checkuser);
         webrequest.verb = HTTPVerb.GET;
         LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
         thread.Start ();
     } else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 10
0
 public void RejectJoinTeamRequest(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     if (parameters.ContainsKey ("token_id") && !string.IsNullOrEmpty (parameters ["token_id"]) &&
         parameters.ContainsKey ("member_id") && !string.IsNullOrEmpty (parameters ["member_id"])) {
         string fulurl = String.Format (URLManager.JoinTeamRequest + "?token_id={0}&member_id={1}", parameters ["token_id"], parameters ["member_id"]);
         parameters.Remove ("token_id");
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (fulurl);
         webrequest.parameters = parameters;
         webrequest.verb = HTTPVerb.DELETE;
         LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
         thread.Start ();
     } else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 11
0
 public void InAppResetPassword(Dictionary<string,string> parameters, MsgHandler responsehander)
 {
     if (parameters.ContainsKey ("token_id") && !string.IsNullOrEmpty (parameters ["token_id"])&&
         parameters.ContainsKey ("new_password") && !string.IsNullOrEmpty (parameters ["new_password"])&&
         parameters.ContainsKey ("old_password") && !string.IsNullOrEmpty (parameters ["old_password"])) {
         string checkuser = String.Format (URLManager.InAppResetPWD + "?token_id={0}",  parameters["token_id"]);
         parameters.Remove ("token_id");
         Tap5050WebRequest webrequest = new Tap5050WebRequest ();
         webrequest.SetURL (checkuser);
         webrequest.parameters = parameters;
         webrequest.verb = HTTPVerb.POST;
         LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
         thread.Start ();
     } else {
         if(responsehander!=null){
             Tap5050WebResponse response = new Tap5050WebResponse ();
             response.available = false;
             response.exceptionreport = new ExceptionReport ("Error:Can not build Request");
             responsehander(response);
         }
     }
 }
Ejemplo n.º 12
0
        public void GetServerURL(Dictionary<string,string> parameters,MsgHandler responsehander)
        {
            var url = String.Format (URLManager.ServerURL + "?location={0}", parameters ["location"]);
            Tap5050WebRequest webrequest = new Tap5050WebRequest ();
            webrequest.SetURL (url);
            webrequest.verb = HTTPVerb.GET;
            LoadContentThread thread = new LoadContentThread (webrequest, responsehander);
            thread.Start ();

            /*
            Tap5050WebRequest webrequest =new Tap5050WebRequest();
            webrequest.SetURL();
            webrequest.verb = HTTPVerb.GET;
            LoadContentThread thread = new LoadContentThread(webrequest, responsehander);
            thread.Start();
            */
        }