コード例 #1
0
 private void BtnJoin_Click(object sender, EventArgs e)
 {
     if (joinKey == null)
     {
         btnJoin.Enabled = false;
         joinGame(JoinMember.save());
     }
 }
コード例 #2
0
 public void Joinmember()
 {
     App.Current.Dispatcher.InvokeAsync(() =>
     {
         JoinMember joinMember = new JoinMember();
         joinMember.ShowDialog();
     });
 }
コード例 #3
0
        private async void BtnWageUp_Click(object sender, EventArgs e)
        {
            int wageCtr = 0;

            if (currentSession.Count == 1)
            {
                MessageBox.Show("Needs 2 or more participants to vote");
                return;
            }
            btnWageUp.Enabled            = false;
            AuthUser.Instance.wageUpVote = true;
            var members = await firebase
                          .Child("Current/Session")
                          .OnceAsync <JoinMember>();

            foreach (var member in members)
            {
                if (member.Key != joinKey && member.Object.wageUpVote)
                {
                    wageCtr++;
                }
            }

            if (wageCtr < currentSession.Count - 1)
            {
                await firebase
                .Child("Current/Session")
                .Child(joinKey)
                .PutAsync(JoinMember.save());

                await firebase
                .Child("Current/Log")
                .PostAsync(Monitor.wageVote());
            }
            else
            {
                foreach (var member in members)
                {
                    await firebase
                    .Child("Current/Session")
                    .Child(member.Key)
                    .PutAsync(JoinMember.upWage(member.Object));
                }
                await firebase
                .Child("Current/Setting")
                .Child(drawSetting.Key)
                .PutAsync(DrawSetting.increaseWage(drawSetting.EnableWageVote));

                await firebase
                .Child("Current/Log")
                .PostAsync(Monitor.wageVote());

                await firebase
                .Child("Current/Log")
                .PostAsync(Monitor.wageUp());
            }
        }
コード例 #4
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                string name    = txtMemberName.Text;
                string Mobile  = txtMobileNo.Text;
                string Email   = txtEmail.Text;
                string country = ddlCountry.SelectedValue;

                DataSet ds = JoinMember.SelfInsertToGroup(name, Mobile, Email, GroupId, country, 0);
                if (ds.Tables[0].Rows.Count > 0)
                {
                    string masterId   = ds.Tables[0].Rows[0]["masterId"].ToString();
                    string isGrpAdmin = ds.Tables[0].Rows[0]["isGrpAdmin"].ToString();

                    // Send SMS if Member is not exists in group
                    if (ds.Tables[0].Rows[0]["memExists"].ToString() == "N")
                    {
                        DataSet dsCountry = new DataSet();
                        dsCountry = JoinMember.CountryCode(country, Mobile, GroupId);

                        if (dsCountry.Tables[0].Rows[0]["isSentSMS"].ToString() == "Yes")
                        {
                            if (dsCountry.Tables[0].Rows[0]["CountryCode"].ToString() == "+91")//for India
                            {
                                if ((JoinMember.SendSMS(ConfigurationManager.AppSettings["dnapp"].ToString(), ConfigurationManager.AppSettings["usrapp"].ToString(), ConfigurationManager.AppSettings["pwdapp"].ToString(), ConfigurationManager.AppSettings["sidapp"].ToString(), Mobile, ds.Tables[0].Rows[0]["member_name"].ToString() + " has invited you to " + lblGroupName.Text + " mobile app powered by TouchBasE . Download link : http://goo.gl/uK2UQQ") == true))
                                {
                                    JoinMember.UpdateSMSCount(GroupId);
                                }
                            }
                            else//for International SMS
                            {
                                if ((JoinMember.SendSMSInternational(Mobile, ds.Tables[0].Rows[0]["member_name"].ToString() + " has invited you to " + lblGroupName.Text + " mobile app powered by TouchBasE . Download link : http://goo.gl/uK2UQQ", dsCountry.Tables[0].Rows[0]["CountryCode"].ToString())) == true)
                                {
                                    JoinMember.UpdateSMSCount(GroupId);
                                }
                            }
                        }
                        //send Mail to user
                        if (Email != "")
                        {
                            JoinMember.SendEmail(ConfigurationManager.AppSettings["frommail"].ToString(), Email.ToString(), Session["LoginProfileName"].ToString() + " has added you to Entity " + lblGroupName.Text + " on TouchBasE.", msgbody(ds.Tables[0].Rows[0]["member_name"].ToString(), lblGroupName.Text));
                            //GlobalFuns.SendElasticEmail(Email, Session["LoginProfileName"].ToString() + " has added you to Entity " + Session["GroupName"].ToString() + " on TouchBase", "", msgbody(Session["LoginProfileName"].ToString(), Session["GroupName"].ToString()), ConfigurationManager.AppSettings["frommail"].ToString(), "touchbase.in");
                        }
                    }

                    System.Web.HttpBrowserCapabilities myBrowserCaps = Request.Browser;
                    if (((System.Web.Configuration.HttpCapabilitiesBase)myBrowserCaps).IsMobileDevice)
                    {
                        //lblmsg.Text = "Browser is a mobile device.";
                        if (HttpContext.Current.Request != null && HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"] != null)
                        {
                            var u = HttpContext.Current.Request.ServerVariables["HTTP_USER_AGENT"].ToString();

                            if (u.Contains("Android"))
                            {
                                // Response.Redirect("https://goo.gl/9YqIl0");
                                Response.Redirect("http://webtest.touchbase.in:8070/JoinTouchbase.aspx?groupId=" + GroupId + "&masterUID=" + masterId + "&isAdmin=" + isGrpAdmin + "&groupName=" + lblGroupName.Text);
                            }
                            else if (u.Contains("iPhone"))
                            {
                                Response.Redirect("https://itunes.apple.com/in/app/touchbase-tb/id1104294041?mt=8");
                            }
                        }
                    }
                    else
                    {
                        lblmsg.Text = "Browser is not a mobile device.Please open this url on you mobile";
                    }
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
コード例 #5
0
 protected void ddlCountry_SelectedIndexChanged(object sender, EventArgs e)
 {
     txtcode.Text = JoinMember.getCountryCode(ddlCountry.SelectedValue.ToString());
 }
コード例 #6
0
 protected void fillcountry()
 {
     JoinMember.FillCombo(ddlCountry, JoinMember.Fill_Combo_sql("SELECT DISTINCT country_master_id,country_master_name FROM country_master WHERE country_master_name!=''"), "country_master_id", "country_master_name", true, "--Select--");
 }
コード例 #7
0
 private async void joinGame(JoinMember j)
 {
     await firebase.Child("Current/Session").PostAsync(j);
 }