Exemplo n.º 1
1
 public TeamFindMemberAdapter(Context context,global::Android.Support.V4.App.Fragment fragment,List<Tap5050PotentialTeamMemberInfo> list,EventCard card)
 {
     nn_fragment = fragment;
     nn_context = context;
     nn_list = list;
     nn_card = card;
 }
Exemplo n.º 2
0
 public TeamViewMemberAdapter(Activity activity,global::Android.Support.V4.App.Fragment fragment,List<Tap5050TeamMemberInfo> list,EventCard card,int type)
 {
     nn_activity = activity;
     nn_list = list;
     nn_card=card;
     nn_type = type;
     nn_fragment = fragment;
 }
Exemplo n.º 3
0
        public void RetrieveEvents()
        {
            if (!string.IsNullOrEmpty (GlobalVariable.currentlocation)) {
                Dictionary<string,string> parameters =new Dictionary<string, string>();
                parameters.Add("token_id",GlobalVariable.token_id);
                App.INSTANCE.networknamager.CheckToken(parameters,(Tap5050WebResponse response)=>{
                    if(response.available){
                        var result=(Tap5050Result)response.parsedobject;
                        if(result.result_success.Equals("Y")){
                            eventlist.Clear ();
                            eventcards.Clear ();
                            confirmedcards.Clear();
                            potencialcards.Clear();
                            Dictionary<string, string> geteventsparameters = new Dictionary<string, string> ();
                            geteventsparameters.Add ("location", GlobalVariable.currentlocation);
                            geteventsparameters.Add ("token_id", GlobalVariable.token_id);
                            App.INSTANCE.networknamager.GetEvents (geteventsparameters,(Tap5050WebResponse geteventsresponse)=>{
                     			if(geteventsresponse.available){
                                 	eventlist=(List<Tap5050Event>)geteventsresponse.parsedobject;
                                    eventlist.Sort(delegate(Tap5050Event x, Tap5050Event y)
                                        {
                                            if (x.have_contract == null || y.have_contract == null) return 0;
                                            else if (x.have_contract.Equals("N")) return 1;
                                            else return -1;
                                        }
                                    );
                                        for(int i=0;i<eventlist.Count;i++){
                                            EventCard eventcard =new EventCard(eventlist[i],detaltimgsmall,detaltimgoriginal);
                                            eventcards.Add(eventcard);
                                        }
                                        for(int m=0;m<eventcards.Count;m++){

                                        if(eventcards[m].eventinfo.have_contract!=null&&eventcards[m].eventinfo.have_contract.Equals("Y")){
                                            confirmedcards.Add(eventcards[m]);
                                        }else{
                                            potencialcards.Add(eventcards[m]);
                                        }
                                            if(!String.IsNullOrEmpty(eventlist[m].image_url)){
                                                App.INSTANCE.networknamager.LoadImage(new Tap5050ImageFlag(m,eventlist[m].image_url,Tap5050ImageFlag.ImageType.OrganizationImage),
                                                    (Tap5050WebResponse imgresponse)=>{
                                                        if(imgresponse.available){
                                                            var array=(byte[])imgresponse.parsedobject;
                                                            var flag=(Tap5050ImageFlag)imgresponse.flagobject;
                                                            try{
                                                                Bitmap imageBitmap= BitmapFactory.DecodeByteArray(array, 0, array.Length);

                                                                //Bitmap imageWithBG = Bitmap.CreateBitmap(imageBitmap.Width, imageBitmap.Height, imageBitmap.GetConfig());  // Create another image the same size
                                                                //imageWithBG.EraseColor(global::Android.Graphics.Color.Transparent);
                                                                //Canvas canvas = new Canvas(imageWithBG);
                                                                //canvas.DrawBitmap(imageBitmap, 0f, 0f, null);
                                                                //imageBitmap.Recycle();

                                                                //var imageBitmaphandle=imageBitmap.Copy(imageBitmap.GetConfig(), true);
                                                                //var imageBitmaphandle = Bitmap.CreateBitmap(imageBitmap.Width, imageBitmap.Height, Bitmap.Config.Argb8888);

                                                                // for (int x = 0; x < imageBitmaphandle.Width; x++)
                                                                //{
                                                                //    for (int y = 0; y < imageBitmaphandle.Height; y++)
                                                                //    { d

                                                                //        if (imageBitmaphandle.GetPixel(x, y) == global::Android.Graphics.Color.White)
                                                                //        {
                                                                //            imageBitmaphandle.SetPixel(x, y, global::Android.Graphics.Color.Transparent);
                                                                //        }
                                                                //    }
                                                                //}

                                                                eventcards[flag.position].originalmap = Bitmap.CreateScaledBitmap(imageBitmap, TapUtil.dptodx(120), TapUtil.dptodx(120), false);
                                                                Bitmap newbitmap=Bitmap.CreateScaledBitmap (imageBitmap, TapUtil.dptodx(50), TapUtil.dptodx(50), false);
                                                                eventcards[flag.position].imagemap=newbitmap;

                                                                nn_activity.RunOnUiThread(()=>{
                                                                    adapter.NotifyDataSetChanged();
                                                                });
                                                            }
                                                            catch(Exception e){
                                                                Console.WriteLine (e);
                                                            }
                                                        }
                                                    });
                                            }
                                        }

                                    //update tap
                                    nn_activity.RunOnUiThread(()=>{
                                        if(showconfirmed){

                                            adapter.ChangeListAndUpdate(confirmedcards);
                                        }
                                        else{
                                            adapter.ChangeListAndUpdate(potencialcards);
                                        }
                                    });

                                        nn_activity.RunOnUiThread(()=>{
                                            if(eventcards.Count==0){

                                            if(noeventcard!=null&&noeventcard.Parent!=null){
                                                (noeventcard.Parent as RelativeLayout).RemoveView(noeventcard);
                                            }

                                                LayoutInflater inflator = LayoutInflater.From (nn_activity);

                                                noeventcard = (LinearLayout)inflator.Inflate (Resource.Layout.raffleroot_noeventcard, null);
                                                RelativeLayout.LayoutParams noeventcardreparam=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent,RelativeLayout.LayoutParams.WrapContent);
                                                noeventcardreparam.AddRule(LayoutRules.Below,locationcontainerlayout.Id);
                                                noeventcard.LayoutParameters=noeventcardreparam;

                                                TextView hinttextview=(TextView)noeventcard.FindViewById(Resource.Id.rafflenoevent_hint_textview);
                                                hinttextview.Text=RaffleListScreenData.NoRaffleText;

                                                EditText charityinput=(EditText)noeventcard.FindViewById(Resource.Id.rafflenoevent_charityinput_edittext);
                                                charityinput.Hint=RaffleListScreenData.organizationNameTextFieldPlaceholder;

                                                EditText numberinput=(EditText)noeventcard.FindViewById(Resource.Id.rafflenoevent_phonenumber_edittext);
                                                numberinput.Hint=RaffleListScreenData.phoneNumberTextFieldPlaceholder;

                                                Button chritysubmitbutton=(Button)noeventcard.FindViewById(Resource.Id.rafflenoevent_charitysubmit_button);
                                                chritysubmitbutton.Text=RaffleListScreenData.sentBtnTitle;
                                                chritysubmitbutton.Click+= (object sender, EventArgs e) => {
                                                //set flags
                                                FormatCheckFlagObject[] flags=new FormatCheckFlagObject[2];
                                                for(int i=0;i<flags.Length;i++){
                                                    string message="";
                                                    if(i==0){
                                                        message=AboutScreenData.organizationNameTextFieldPlaceholder;
                                                    }
                                                    if(i==1){
                                                        message=AboutScreenData.phoneNumberTextFieldPlaceholder;
                                                    }
                                                }

                                                //
                                                if(FormatManager.chechinput(charityinput.Text,FormatManager.FormatOption.OnlyLetter)){
                                                    flags[0].flag=true;
                                                }
                                                if(FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Phone)){
                                                    flags[1].flag=true;
                                                }
                                                bool totalfalg=true;
                                                foreach(var flagobj in flags){
                                                    if(!flagobj.flag){
                                                        totalfalg=false;
                                                    }
                                                }
                                                if(totalfalg){
                                                    SocialShareAndroid.Email (string.Format(RaffleListScreenData.RequestRaffleEmailBody,GlobalVariable.username,GlobalVariable.currentlocation,charityinput.Text,numberinput.Text),RaffleListScreenData.RequestRaffleEmailSubject,new string[]{RaffleListScreenData.RequestRaffleEmailTarget});
                                                }
                                                else{
                                                    string message="Please check:\n";
                                                    for(int i=0;i<flags.Length;i++){
                                                        if(flags[i].flag==false){
                                                            if(i!=flags.Length-1){
                                                                message+=flags[i].message+",";
                                                            }else{
                                                                message+=flags[i].message;
                                                            }
                                                        }
                                                    }
                                                    nn_activity.ShowCustomAlterDialogFragment(AboutScreenData.AlertScreenFormatErrorTitle,message,GlobalScreenData.DefaultPositive,null,"invalidedialog.raffleroot.noeventinput");
                                                }
                                            };
            //												if(FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Phone)&&FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Regular)&&FormatManager.chechinput(charityinput.Text,FormatManager.FormatOption.Regular)){
            //													SocialShareAndroid.Email (string.Format(RaffleListScreenData.RequestRaffleEmailBody,GlobalVariable.username,nn_location,charityinput.Text,numberinput.Text),RaffleListScreenData.RequestRaffleEmailSubject,new string[]{RaffleListScreenData.RequestRaffleEmailTarget});
            //												}
            //												else if(!FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Regular)||!FormatManager.chechinput(charityinput.Text,FormatManager.FormatOption.Regular)){
            //													nn_activity.ShowCustomAlterDialogFragment("Both input can not be empty",GlobalScreenData.DefaultPositive,null,"invalidedialog.raffleroot.noeventinput");
            //												}
            //												else if (!FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Phone)){
            //													nn_activity.ShowCustomAlterDialogFragment("Please check format of your phone number",GlobalScreenData.DefaultPositive,null,"invalidedialog.raffleroot.noeventcardnumber");
            //												}
            //
            //												};
                                                rootview.AddView(noeventcard);
                                        }// end of if eventcards.Count==0

                                        RemoveSpinner(rootview);
                                        });
                                    }else{
                                    nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.WebExceptionTitle,response.exceptionreport.errormessage,GlobalScreenData.WebExceptionPositive,GlobalScreenData.WebExceptionNegative,"exceptiondialog.getevents");
                                    }

                                }); //end of getevents

                            //for pop alert for teanm events
                            popthread.ClearQueue();
                            teaminvitations.Clear();
                            teamrequests.Clear();
                            popinitialized=false;
                            //get invitation notifications
                            Dictionary<string, string> getinvitaitonsparameters = new Dictionary<string, string> ();
                            getinvitaitonsparameters.Add ("token_id", GlobalVariable.token_id);
                            App.INSTANCE.networknamager.GetTeamInvitationNotification (getinvitaitonsparameters,(Tap5050WebResponse getinviationresponse)=>{
                                if(getinviationresponse.available){
                                    teaminvitations=(List<Tap5050TeamInvitation>)getinviationresponse.parsedobject;
                                    popthread.Push(teaminvitations);
                                    if(popinitialized){
                                        popthread.SetSignal();
                                    }
                                    popinitialized=true;
                                    //									if(teaminvitations.Count>0){
                                    //										var invitaioninfo=teaminvitations[0];
                                    //										nn_activity.ShowCustomNeutralAlterDialogFragment(TeamScreenData.InvitationPopTitle,string.Format(TeamScreenData.InvitationPopDetail,invitaioninfo.leader_first_name+" "+invitaioninfo.leader_last_name,invitaioninfo.group_name,invitaioninfo.event_name),
                                    //											TeamScreenData.InvitationPopPositive,TeamScreenData.InvitationPopNegative,TeamScreenData.InvitationPopNeurtal,"invitepop.relationships.team",invitaioninfo);
                                    //										teaminvitations.RemoveAt(0);
                                    //									}
                                }
                            });
                            //get all reqeust
                            Dictionary<string, string> getreqeustsparameters = new Dictionary<string, string> ();
                            getreqeustsparameters.Add ("token_id", GlobalVariable.token_id);
                            App.INSTANCE.networknamager.GetJoinTeamRequestNotification (getreqeustsparameters,(Tap5050WebResponse getreqeustresponse)=>{
                                if(getreqeustresponse.available){
                                    teamrequests=(List<Tap5050TeamRequest>)getreqeustresponse.parsedobject;
                                    popthread.Push(teamrequests);
                                }
                                if(popinitialized){
                                    popthread.SetSignal();
                                }
                                popinitialized=true;

                            });

                        }
                        else{
                            nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.InvalidetokenTitle,GlobalScreenData.InvalidetokenMessage,GlobalScreenData.DefaultPositive,"invalidedialog.raffleroot.checktoken");
                        }
                    }//end of token available
                        else{
                        nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.WebExceptionTitle,response.exceptionreport.errormessage,GlobalScreenData.WebExceptionPositive,GlobalScreenData.WebExceptionNegative,"exceptiondialog.raffleroot.gettoken");
                        }
                    });//end of get token

            }
        }
Exemplo n.º 4
0
        public void RetrieveEvents()
        {
            if (!string.IsNullOrEmpty (GlobalVariable.currentlocation)) {
                Dictionary<string,string> parameters =new Dictionary<string, string>();
                parameters.Add("token_id",GlobalVariable.token_id);
                App.INSTANCE.networknamager.CheckToken(parameters,(Tap5050WebResponse response)=>{
                    if(response.available){
                        var result=(Tap5050Result)response.parsedobject;
                        if(result.result_success.Equals("Y")){
                            eventlist.Clear ();
                            eventcards.Clear ();
                            Dictionary<string, string> geteventsparameters = new Dictionary<string, string> ();
                            geteventsparameters.Add ("location", GlobalVariable.currentlocation);
                            geteventsparameters.Add ("token_id", GlobalVariable.token_id);
                            App.INSTANCE.networknamager.GetEvents (geteventsparameters,(Tap5050WebResponse geteventsresponse)=>{
                            if(geteventsresponse.available){
                                    eventlist=(List<Tap5050Event>)geteventsresponse.parsedobject;
                                    eventlist.Sort(delegate(Tap5050Event x, Tap5050Event y){
                                            if (x.have_contract == null || y.have_contract == null) return 0;
                                            else if (x.have_contract.Equals("N")) return 1;
                                            else return -1;
                                        }
                                    );
                                    for(int i=0;i<eventlist.Count;i++){
                                            EventCard eventcard =new EventCard(eventlist[i],detaltimgsmall,detaltimgoriginal);
                                            eventcards.Add(eventcard);
                                    }
                                    for(int m=0;m<eventcards.Count;m++){
                                        if(!String.IsNullOrEmpty(eventlist[m].image_url)){
                                            App.INSTANCE.networknamager.LoadImage(new Tap5050ImageFlag(m,eventlist[m].image_url,Tap5050ImageFlag.ImageType.OrganizationImage),
                                                (Tap5050WebResponse imgresponse)=>{
                                                    if(imgresponse.available){
                                                        var array=(byte[])imgresponse.parsedobject;
                                                        var flag=(Tap5050ImageFlag)imgresponse.flagobject;
                                                        try{
                                                            Bitmap imageBitmap= BitmapFactory.DecodeByteArray(array, 0, array.Length);
                                                            eventcards[flag.position].originalmap=Bitmap.CreateScaledBitmap (imageBitmap, TapUtil.dptodx(120), TapUtil.dptodx(120), false);
                                                            Bitmap newbitmap=Bitmap.CreateScaledBitmap (imageBitmap, TapUtil.dptodx(40), TapUtil.dptodx(40), false);
                                                            eventcards[flag.position].imagemap=newbitmap;

                                                            nn_activity.RunOnUiThread(()=>{
                                                                adapter.NotifyDataSetChanged();
                                                            });
                                                        }
                                                        catch(Exception e){
                                                            Console.WriteLine (e);
                                                        }
                                                    }
                                                });
                                        }
                                    }
                                        nn_activity.RunOnUiThread(()=>{
                                            if(eventcards.Count==0){
                                            if(noeventcard!=null&&noeventcard.Parent!=null){
                                                (noeventcard.Parent as RelativeLayout).RemoveView(noeventcard);
                                            }
                                                LayoutInflater inflator = LayoutInflater.From (nn_activity);
                                                noeventcard = (LinearLayout)inflator.Inflate (Resource.Layout.raffleroot_noeventcard, null);
                                                RelativeLayout.LayoutParams noeventcardreparam=new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MatchParent,RelativeLayout.LayoutParams.WrapContent);
                                                noeventcardreparam.AddRule(LayoutRules.Below,locationcontainerlayout.Id);
                                                noeventcard.LayoutParameters=noeventcardreparam;
                                                TextView hinttextview=(TextView)noeventcard.FindViewById(Resource.Id.rafflenoevent_hint_textview);
                                                hinttextview.Text=RaffleListScreenData.NoRaffleText;
                                                EditText charityinput=(EditText)noeventcard.FindViewById(Resource.Id.rafflenoevent_charityinput_edittext);
                                                charityinput.Hint=RaffleListScreenData.organizationNameTextFieldPlaceholder;
                                                EditText numberinput=(EditText)noeventcard.FindViewById(Resource.Id.rafflenoevent_phonenumber_edittext);
                                                numberinput.Hint=RaffleListScreenData.phoneNumberTextFieldPlaceholder;
                                                Button chritysubmitbutton=(Button)noeventcard.FindViewById(Resource.Id.rafflenoevent_charitysubmit_button);
                                                chritysubmitbutton.Text=RaffleListScreenData.sentBtnTitle;
                                                chritysubmitbutton.Click+= (object sender, EventArgs e) => {
                                                //set flags
                                                FormatCheckFlagObject[] flags=new FormatCheckFlagObject[2];
                                                for(int i=0;i<flags.Length;i++){
                                                    string message="";
                                                    if(i==0){
                                                        message=AboutScreenData.organizationNameTextFieldPlaceholder;
                                                    }
                                                    if(i==1){
                                                        message=AboutScreenData.phoneNumberTextFieldPlaceholder;
                                                    }
                                                }

                                                //
                                                if(FormatManager.chechinput(charityinput.Text,FormatManager.FormatOption.OnlyLetter)){
                                                    flags[0].flag=true;
                                                }
                                                if(FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Phone)){
                                                    flags[1].flag=true;
                                                }
                                                bool totalfalg=true;
                                                foreach(var flagobj in flags){
                                                    if(!flagobj.flag){
                                                        totalfalg=false;
                                                    }
                                                }
                                                if(totalfalg){
                                                    SocialShareAndroid.Email (string.Format(RaffleListScreenData.RequestRaffleEmailBody,GlobalVariable.username,GlobalVariable.currentlocation,charityinput.Text,numberinput.Text),RaffleListScreenData.RequestRaffleEmailSubject,new string[]{RaffleListScreenData.RequestRaffleEmailTarget});
                                                }
                                                else{
                                                    string message="Please check:\n";
                                                    for(int i=0;i<flags.Length;i++){
                                                        if(flags[i].flag==false){
                                                            if(i!=flags.Length-1){
                                                                message+=flags[i].message+",";
                                                            }else{
                                                                message+=flags[i].message;
                                                            }
                                                        }
                                                    }
                                                    nn_activity.ShowCustomAlterDialogFragment(AboutScreenData.AlertScreenFormatErrorTitle,message,"OK",null,"invalidedialog.raffleroot.noeventinput");
                                                }
                                            };
            //												if(FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Phone)&&FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Regular)&&FormatManager.chechinput(charityinput.Text,FormatManager.FormatOption.Regular)){
            //													SocialShareAndroid.Email (string.Format(RaffleListScreenData.RequestRaffleEmailBody,GlobalVariable.username,nn_location,charityinput.Text,numberinput.Text),RaffleListScreenData.RequestRaffleEmailSubject,new string[]{RaffleListScreenData.RequestRaffleEmailTarget});
            //												}
            //												else if(!FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Regular)||!FormatManager.chechinput(charityinput.Text,FormatManager.FormatOption.Regular)){
            //													nn_activity.ShowCustomAlterDialogFragment("Both input can not be empty","OK",null,"invalidedialog.raffleroot.noeventinput");
            //												}
            //												else if (!FormatManager.chechinput(numberinput.Text,FormatManager.FormatOption.Phone)){
            //													nn_activity.ShowCustomAlterDialogFragment("Please check format of your phone number","OK",null,"invalidedialog.raffleroot.noeventcardnumber");
            //												}
            //
            //												};
                                                rootview.AddView(noeventcard);
                                            }
                                        adapter.NotifyListChange();
                                        RemoveSpinner(rootview);
                                        });
                                    }else{
                                    nn_activity.ShowCustomAlterDialogFragment(RaffleListScreenData.AlertScreenLoadRafflesFailTitle,response.exceptionreport.errormessage,GlobalScreenData.WebExceptionPositive,GlobalScreenData.WebExceptionNegative,"exceptiondialog.getevents");
                                    }

                                }); //end of getevents
                        }
                        else{
                            nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.InvalidetokenTitle,GlobalScreenData.InvalidetokenMessage,"Ok",null,"invalidedialog.raffleroot.checktoken");
                        }
                    }//end of token available
                        else{
                        nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.WebExceptionTitle,response.exceptionreport.errormessage,GlobalScreenData.WebExceptionPositive,GlobalScreenData.WebExceptionNegative,"exceptiondialog.raffleroot.gettoken");
                        }
                    });//end of get token

            }
        }
Exemplo n.º 5
0
        public void ShowTeamMemberViewFragment(EventCard card,int type)
        {
            if (!IsFinishing) {
                var fragment = new TeamMemberViewFragment ();
                fragment.nn_card = card;
                fragment.nn_type = type;

                var ft = SupportFragmentManager.BeginTransaction ();
                ft.Replace (Resource.Id.home_content_framelayout, fragment);
                ft.AddToBackStack (null);
                ft.CommitAllowingStateLoss ();
                currentfragment = (global::Android.Support.V4.App.Fragment)fragment;

            }
        }
Exemplo n.º 6
0
        public void ShowSMSFragment(EventCard eventcard,string mesage,string contactstring,List<string> numberlist)
        {
            if(!IsFinishing){
                var fragment =new SendSMSFragment ();
                fragment.nn_numberlist=numberlist;
                fragment.nn_message = mesage;
                fragment.nn_contacts = contactstring;
                fragment.nn_eventcard = eventcard;

                var ft = SupportFragmentManager.BeginTransaction ();
                ft.Replace (Resource.Id.home_content_framelayout, fragment);
                ft.AddToBackStack (null);
                ft.CommitAllowingStateLoss ();
                currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
            }
        }
Exemplo n.º 7
0
 //canceled carosel
 //type represent confirmed or not
 //        public void ShowRaffleDetailFragment(List<EventCard> cards, int initialposition,int type){
 //            if(!IsFinishing){
 //                var fragment =new RaffleDetailRootFragment ();
 //                fragment.eventcards = cards;
 //                fragment.initialpage = initialposition;
 //                fragment.type = type;
 //                var ft = SupportFragmentManager.BeginTransaction ();
 //                ft.Replace (Resource.Id.home_content_framelayout, fragment);
 //                ft.AddToBackStack (null);
 //                ft.CommitAllowingStateLoss ();
 //                currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
 //            }
 //        }
 public void ShowRaffleDetailFragment(EventCard card)
 {
     if(!IsFinishing){
         var fragment =new RaffleDetailFragment ();
         fragment.eventcard = card;
         var ft = SupportFragmentManager.BeginTransaction ();
         ft.Replace (Resource.Id.home_content_framelayout, fragment);
         ft.AddToBackStack (null);
         ft.CommitAllowingStateLoss ();
         currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
     }
 }
Exemplo n.º 8
0
 public void ShowGetTemppassFragmentAutoSendRequest(EventCard card,string email)
 {
     if(!IsFinishing){
         var fragment =new RaffleGetTempPassFragment ();
         fragment.nn_eventcard = card;
         fragment.autosendemail = email;
         var ft = SupportFragmentManager.BeginTransaction ();
         ft.Replace (Resource.Id.home_content_framelayout, fragment,"GetTemppassFragment");
         ft.AddToBackStack (null);
         ft.CommitAllowingStateLoss ();
         currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
     }
 }
Exemplo n.º 9
0
        public void ShowEmailListPicker(EventCard eventcard,string Organization,string BuyTicketUrl,string LocationName)
        {
            if(!IsFinishing){
                var fragment =new EmailListFragment ();
                fragment.nn_eventcard = eventcard;
                fragment.nn_Organization = Organization;
                fragment.nn_BuyTicketUrl = BuyTicketUrl;
                fragment.nn_LocationName = LocationName;

                var ft = SupportFragmentManager.BeginTransaction ();
                ft.Replace (Resource.Id.home_content_framelayout, fragment);
                ft.AddToBackStack (null);
                ft.CommitAllowingStateLoss ();
                currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
            }
        }
Exemplo n.º 10
0
 ///<summary>
 ///typeflag== 0 input is email, or 1 input is phone
 ///</summary>
 public void ShowBuyerSignUp(EventCard card,string input,int typeflag)
 {
     if(!IsFinishing){
         var fragment =new RaffleBuyerSignUpFragment ();
         if (typeflag == 0) {
             fragment.nn_email = input;
         } else {
             fragment.nn_phone = input;
         }
         fragment.nn_eventcard = card;
         var ft = SupportFragmentManager.BeginTransaction ();
         ft.Replace (Resource.Id.home_content_framelayout, fragment);
         ft.AddToBackStack (null);
         ft.CommitAllowingStateLoss ();
         currentfragment = (global::Android.Support.V4.App.Fragment)fragment;
     }
 }
Exemplo n.º 11
0
        public void LoadTeam()
        {
            nn_activity.RunOnUiThread (() => {
                AddSpinner (rootview, TeamScreenData.LoadTeamSpinner);
                teamadapter = new RelationshipTeamListAdapter (nn_activity,this,confirmedcards);
                relationshiplistview.Adapter = teamadapter;
            });

            if (!string.IsNullOrEmpty (GlobalVariable.currentlocation)) {
                Dictionary<string,string> parameters =new Dictionary<string, string>();
                parameters.Add("token_id",GlobalVariable.token_id);
                App.INSTANCE.networknamager.CheckToken(parameters,(Tap5050WebResponse response)=>{
                    if(response.available){
                        var result=(Tap5050Result)response.parsedobject;
                        if(result.result_success.Equals("Y")){
                            eventcards.Clear();
                            eventlist.Clear();
                            confirmedcards.Clear();
                            Dictionary<string, string> geteventsparameters = new Dictionary<string, string> ();
                            geteventsparameters.Add ("location", GlobalVariable.currentlocation);
                            geteventsparameters.Add ("token_id", GlobalVariable.token_id);
                            App.INSTANCE.networknamager.GetEvents (geteventsparameters,(Tap5050WebResponse geteventsresponse)=>{
                                if(geteventsresponse.available){
                                    eventlist=(List<Tap5050Event>)geteventsresponse.parsedobject;
                                    eventlist.Sort(delegate(Tap5050Event x, Tap5050Event y)
                                        {
                                            if (x.have_contract == null || y.have_contract == null) return 0;
                                            else if (x.have_contract.Equals("N")) return 1;
                                            else return -1;
                                        }
                                    );
                                    for(int i=0;i<eventlist.Count;i++){
                                        EventCard eventcard =new EventCard(eventlist[i],detaltimgsmall,detaltimgoriginal);
                                        eventcards.Add(eventcard);
                                    }
                                    for(int m=0;m<eventcards.Count;m++){

                                     if(eventcards[m].eventinfo.have_contract!=null&&eventcards[m].eventinfo.have_contract.Equals("Y")){
                                            confirmedcards.Add(eventcards[m]);
                                     }
                                    if(!String.IsNullOrEmpty(eventlist[m].image_url)){
                                        App.INSTANCE.networknamager.LoadImage(new Tap5050ImageFlag(m,eventlist[m].image_url,Tap5050ImageFlag.ImageType.OrganizationImage),
                                            (Tap5050WebResponse imgresponse)=>{
                                                if(imgresponse.available){
                                                    var array=(byte[])imgresponse.parsedobject;
                                                    var flag=(Tap5050ImageFlag)imgresponse.flagobject;
                                                    try{
                                                        Bitmap imageBitmap= BitmapFactory.DecodeByteArray(array, 0, array.Length);
                                                        eventcards[flag.position].originalmap=Bitmap.CreateScaledBitmap (imageBitmap, TapUtil.dptodx(120), TapUtil.dptodx(120), false);
                                                        Bitmap newbitmap=Bitmap.CreateScaledBitmap (imageBitmap, TapUtil.dptodx(50), TapUtil.dptodx(50), false);
                                                        eventcards[flag.position].imagemap=newbitmap;

                                                        nn_activity.RunOnUiThread(()=>{
                                                                teamadapter.NotifyDataSetChanged();
                                                        });
                                                    }
                                                    catch(Exception e){
                                                        Console.WriteLine (e);
                                                    }
                                                }
                                            });
                                        }
                                    }
                                    //update tap
                                    nn_activity.RunOnUiThread(()=>{
                                        if(!showorganization){
                                            teamadapter.nn_list=confirmedcards;
                                            teamadapter.NotifyDataSetChanged();
                                        }
                                    RemoveSpinner(rootview);
                                });
                            }else{
                                    nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.WebExceptionTitle,geteventsresponse.exceptionreport.errormessage,GlobalScreenData.WebExceptionPositive,GlobalScreenData.WebExceptionNegative,"exceptiondialog.getteamralaships");
                            }
                            });

                            //for pop alert for teanm events
                            popthread.ClearQueue();
                            teaminvitations.Clear();
                            teamrequests.Clear();
                            popinitialized=false;
                            //get invitation notifications
                            Dictionary<string, string> getinvitaitonsparameters = new Dictionary<string, string> ();
                            getinvitaitonsparameters.Add ("token_id", GlobalVariable.token_id);
                            App.INSTANCE.networknamager.GetTeamInvitationNotification (getinvitaitonsparameters,(Tap5050WebResponse getinviationresponse)=>{
                                if(getinviationresponse.available){
                                    teaminvitations=(List<Tap5050TeamInvitation>)getinviationresponse.parsedobject;
                                    popthread.Push(teaminvitations);
                                    if(popinitialized){
                                        popthread.SetSignal();
                                    }
                                    popinitialized=true;
            //									if(teaminvitations.Count>0){
            //										var invitaioninfo=teaminvitations[0];
            //										nn_activity.ShowCustomNeutralAlterDialogFragment(TeamScreenData.InvitationPopTitle,string.Format(TeamScreenData.InvitationPopDetail,invitaioninfo.leader_first_name+" "+invitaioninfo.leader_last_name,invitaioninfo.group_name,invitaioninfo.event_name),
            //											TeamScreenData.InvitationPopPositive,TeamScreenData.InvitationPopNegative,TeamScreenData.InvitationPopNeurtal,"invitepop.relationships.team",invitaioninfo);
            //										teaminvitations.RemoveAt(0);
            //									}
                                }
                            });
                            //get all reqeust
                            Dictionary<string, string> getreqeustsparameters = new Dictionary<string, string> ();
                            getreqeustsparameters.Add ("token_id", GlobalVariable.token_id);
                            App.INSTANCE.networknamager.GetJoinTeamRequestNotification (getreqeustsparameters,(Tap5050WebResponse getreqeustresponse)=>{
                                if(getreqeustresponse.available){
                                    teamrequests=(List<Tap5050TeamRequest>)getreqeustresponse.parsedobject;
                                    popthread.Push(teamrequests);
                                }
                                if(popinitialized){
                                    popthread.SetSignal();
                                }
                                popinitialized=true;

                            });

                        }//end of success get token
                        else{
                            nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.InvalidetokenTitle,GlobalScreenData.InvalidetokenMessage,GlobalScreenData.DefaultPositive,null,"invalidedialog.raffledetail.checktoken");
                        }
                    }else{
                        nn_activity.ShowCustomAlterDialogFragment(GlobalScreenData.WebExceptionTitle,response.exceptionreport.errormessage,GlobalScreenData.WebExceptionPositive,GlobalScreenData.WebExceptionNegative,"exceptiondialog.getteamralaships");
                    }
                });//end of get token
            }
        }
Exemplo n.º 12
0
 //invite people click
 public void InviteMember(EventCard card)
 {
     (nn_activity as HomeScreen).ShowTeamFindPotentialMemberFragment (card);
 }