protected void BtnSubmit_Click(object sender, EventArgs e)
        {
          
               // EntityServiceReference.EntityServiceClient ServiceClient = new EntityServiceReference.EntityServiceClient();
                //ServiceClient.Open();
                String WebMemberId = "";
                // get max id
                try
                {
                    //var MaxIdValue = ServiceClient.GetMaxMemberId();
                    //if (MaxIdValue.Length > 0)
                    //{
                    //    //String[] arr = new String[3];
                    //    //arr = MaxIdValue[0].Member_Id.ToString().Split('-');
                    //    //int NewMaxId = Convert.ToInt32(arr[1].ToString()) + 1;
                    //    //WebMemberId = "TMP-" + NewMaxId.ToString();
                    //    int NewMaxId = Convert.ToInt32(MaxIdValue[0].No_) + 1;
                    //    WebMemberId = NewMaxId.ToString();                  

                    //}
                    //else
                    //{  // first user
                    //    WebMemberId = "1";
                    //}
                    //ServiceClient.Close();
                    EntityServiceReference.EntityServiceClient ServiceClientInsert2 = new EntityServiceReference.EntityServiceClient();
                    ServiceClientInsert2.Open();
                    var MobileNo = ServiceClientInsert2.MobilenoExist(txtMobileNo.Text.ToString());
                    
                    EntityServiceReference.EntityServiceClient ServiceClientInsert1 = new EntityServiceReference.EntityServiceClient();
                    ServiceClientInsert1.Open();
                    var emailconfirm = ServiceClientInsert1.EmailExists(txtEmailId.Text.ToString());
                    if (emailconfirm > 0)
                    {
                        ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Email Already Exist..!!');", true);
                    }
                   else if (MobileNo > 0)
                    {
                        ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('MobileNo. Already Exist..!!');", true);
                    }
                    else
                    {


                        DateTime dtdoa;
                        String Dob = ddlmonth.SelectedValue.ToString() + "/" + ddlday.SelectedValue.ToString() + "/" + ddlyear.SelectedValue.ToString();
                        String Doa = DdlMonthAnniversary.SelectedValue.ToString() + "/" + DdlDayAnniversary.SelectedValue.ToString() + "/" + DdlYearAnniversary.SelectedValue.ToString();
                        DateTime dtdob = Convert.ToDateTime(Dob);
                        dtdoa = Convert.ToDateTime(Doa);
                        txtDesignation.Text = "";
                        txtPassword.Text = "";
                        Decimal paidamount = Convert.ToDecimal(0.00);
                        if (RdGender.SelectedValue.ToString().Equals("Mr."))
                        {
                            Gender = "Male";
                        }
                        else
                        {
                            Gender = "Female";
                        }
                        if (RdMartialStatus.SelectedValue.ToString().Equals("Married"))
                        {
                            dtdoa = Convert.ToDateTime(Doa);
                        }
                        else
                        {
                            dtdoa = DateTime.Parse("01/01/1753");
                        }
                        EntityServiceReference.EntityServiceClient ServiceClientInsert = new EntityServiceReference.EntityServiceClient();
                        ServiceClientInsert.Open();
                        var confirm = ServiceClientInsert.registeruserwithoutpayment(WebMemberId, RdGender.SelectedValue.ToString(), txtFirstName.Text.ToString(), txtLastName.Text.ToString(), txtAddress.Text.ToString(), txtAddress.Text.ToString(), txtCity.Text.ToString(), txtCountry.Text.ToString(), txtMobileNo.Text.ToString(), txtMobileNo.Text.ToString(), txtEmailId.Text.ToString(), dtdob, dtdoa, RdMartialStatus.SelectedValue.ToString(), Gender, paidamount, DateTime.Now, "0", "-", txtEmailId.Text.ToString(), txtPassword.Text.ToString(), txtDesignation.Text.ToString(), false, false);
                        if (confirm.Length > 0)
                        {
                            WebMemberId = confirm[0].tempwebid.Value.ToString();
                            //***************this is used to trace the useer redirect from mailer********************
                            #region for update Royal_MailerTracker
                            if (Session["mailerid"].ToString() != "" && Session["mailerid"] != null)
                            {
                                string str = "update [dbo].[Royal_MailerTracker] set Name='" + txtFirstName.Text + "',EMail='" + txtEmailId.Text + "',WebID=" + WebMemberId + ",MobileNo='" + txtMobileNo.Text + "' where ID=" + Convert.ToInt64(Session["mailerid"].ToString());
                                SqlCommand scmd = new SqlCommand(str, con);
                                try
                                {
                                    con.Open();
                                    scmd.ExecuteNonQuery();
                                }
                                catch (SqlException ex)
                                {
                                }
                                finally
                                {
                                    con.Close();
                                }
                            }
                            #endregion for update Royal_MailerTracker
                            //**********************************************************************************************
                            HTMLSignUpMailer(WebMemberId);
                            Response.Redirect("UserRegisterationSuccess.aspx");
                        }

                        ServiceClientInsert.Close();
                        ServiceClientInsert1.Close();
                        ServiceClientInsert2.Close();
                    }
                }
                catch (Exception ex)
                {
                    LblMsg.Text = ex.Message;
                }
            
                
        }
Exemple #2
0
        protected void BtnSubmit_Click(object sender, EventArgs e)
        {
            // EntityServiceReference.EntityServiceClient ServiceClient = new EntityServiceReference.EntityServiceClient();
            //ServiceClient.Open();
            String WebMemberId = "";

            // get max id
            try
            {
                //var MaxIdValue = ServiceClient.GetMaxMemberId();
                //if (MaxIdValue.Length > 0)
                //{
                //    //String[] arr = new String[3];
                //    //arr = MaxIdValue[0].Member_Id.ToString().Split('-');
                //    //int NewMaxId = Convert.ToInt32(arr[1].ToString()) + 1;
                //    //WebMemberId = "TMP-" + NewMaxId.ToString();
                //    int NewMaxId = Convert.ToInt32(MaxIdValue[0].No_) + 1;
                //    WebMemberId = NewMaxId.ToString();

                //}
                //else
                //{  // first user
                //    WebMemberId = "1";
                //}
                //ServiceClient.Close();
                EntityServiceReference.EntityServiceClient ServiceClientInsert2 = new EntityServiceReference.EntityServiceClient();
                ServiceClientInsert2.Open();
                var MobileNo = ServiceClientInsert2.MobilenoExist(txtMobileNo.Text.ToString());

                EntityServiceReference.EntityServiceClient ServiceClientInsert1 = new EntityServiceReference.EntityServiceClient();
                ServiceClientInsert1.Open();
                var emailconfirm = ServiceClientInsert1.EmailExists(txtEmailId.Text.ToString());
                if (emailconfirm > 0)
                {
                    ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Email Already Exist..!!');", true);
                }
                else if (MobileNo > 0)
                {
                    ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('MobileNo. Already Exist..!!');", true);
                }
                else
                {
                    DateTime dtdoa;
                    String   Dob   = ddlmonth.SelectedValue.ToString() + "/" + ddlday.SelectedValue.ToString() + "/" + ddlyear.SelectedValue.ToString();
                    String   Doa   = DdlMonthAnniversary.SelectedValue.ToString() + "/" + DdlDayAnniversary.SelectedValue.ToString() + "/" + DdlYearAnniversary.SelectedValue.ToString();
                    DateTime dtdob = Convert.ToDateTime(Dob);
                    dtdoa = Convert.ToDateTime(Doa);
                    txtDesignation.Text = "";
                    txtPassword.Text    = "";
                    Decimal paidamount = Convert.ToDecimal(0.00);
                    if (RdGender.SelectedValue.ToString().Equals("Mr."))
                    {
                        Gender = "Male";
                    }
                    else
                    {
                        Gender = "Female";
                    }
                    if (RdMartialStatus.SelectedValue.ToString().Equals("Married"))
                    {
                        dtdoa = Convert.ToDateTime(Doa);
                    }
                    else
                    {
                        dtdoa = DateTime.Parse("01/01/1753");
                    }
                    EntityServiceReference.EntityServiceClient ServiceClientInsert = new EntityServiceReference.EntityServiceClient();
                    ServiceClientInsert.Open();
                    var confirm = ServiceClientInsert.registeruserwithoutpayment(WebMemberId, RdGender.SelectedValue.ToString(), txtFirstName.Text.ToString(), txtLastName.Text.ToString(), txtAddress.Text.ToString(), txtAddress.Text.ToString(), txtCity.Text.ToString(), txtCountry.Text.ToString(), txtMobileNo.Text.ToString(), txtMobileNo.Text.ToString(), txtEmailId.Text.ToString(), dtdob, dtdoa, RdMartialStatus.SelectedValue.ToString(), Gender, paidamount, DateTime.Now, "0", "-", txtEmailId.Text.ToString(), txtPassword.Text.ToString(), txtDesignation.Text.ToString(), false, false);
                    if (confirm.Length > 0)
                    {
                        WebMemberId = confirm[0].tempwebid.Value.ToString();
                        //***************this is used to trace the useer redirect from mailer********************
                        #region for update Royal_MailerTracker
                        if (Session["mailerid"].ToString() != "" && Session["mailerid"] != null)
                        {
                            string     str  = "update [dbo].[Royal_MailerTracker] set Name='" + txtFirstName.Text + "',EMail='" + txtEmailId.Text + "',WebID=" + WebMemberId + ",MobileNo='" + txtMobileNo.Text + "' where ID=" + Convert.ToInt64(Session["mailerid"].ToString());
                            SqlCommand scmd = new SqlCommand(str, con);
                            try
                            {
                                con.Open();
                                scmd.ExecuteNonQuery();
                            }
                            catch (SqlException ex)
                            {
                            }
                            finally
                            {
                                con.Close();
                            }
                        }
                        #endregion for update Royal_MailerTracker
                        //**********************************************************************************************
                        HTMLSignUpMailer(WebMemberId);
                        Response.Redirect("UserRegisterationSuccess.aspx");
                    }

                    ServiceClientInsert.Close();
                    ServiceClientInsert1.Close();
                    ServiceClientInsert2.Close();
                }
            }
            catch (Exception ex)
            {
                LblMsg.Text = ex.Message;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            String WebMemberId = "";
            // get max id
            try
            {
                EntityServiceReference.EntityServiceClient ServiceClientInsert2 = new EntityServiceReference.EntityServiceClient();
                ServiceClientInsert2.Open();
                var MobileNo = ServiceClientInsert2.MobilenoExist(txtMobileNo.Text.ToString());

                EntityServiceReference.EntityServiceClient ServiceClientInsert1 = new EntityServiceReference.EntityServiceClient();
                ServiceClientInsert1.Open();
                var emailconfirm = ServiceClientInsert1.EmailExists(txtEmailId.Text.ToString());
                if (emailconfirm > 0)
                {
                    ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Email Already Exist..!!');", true);
                }
                else if (MobileNo > 0)
                {
                    ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('MobileNo. Already Exist..!!');", true);
                }
                else
                {
                    DateTime dtdoa;
                    String Dob = ddlmonth.SelectedValue.ToString() + "/" + ddlday.SelectedValue.ToString() + "/" + ddlyear.SelectedValue.ToString();
                    String Doa = DdlMonthAnniversary.SelectedValue.ToString() + "/" + DdlDayAnniversary.SelectedValue.ToString() + "/" + DdlYearAnniversary.SelectedValue.ToString();
                    DateTime dtdob = Convert.ToDateTime(Dob);
                    dtdoa = Convert.ToDateTime(Doa);
                    txtDesignation.Text = "";
                    txtPassword.Text = "";
                    Decimal paidamount = Convert.ToDecimal(0.00);
                    if (RdGender.SelectedValue.ToString().Equals("Mr."))
                    {
                        Gender = "Male";
                    }
                    else
                    {
                        Gender = "Female";
                    }
                    if (RdMartialStatus.SelectedValue.ToString().Equals("Married"))
                    {
                        dtdoa = Convert.ToDateTime(Doa);
                    }
                    else
                    {
                        dtdoa = DateTime.Parse("01/01/1753");
                    }
                    EntityServiceReference.EntityServiceClient ServiceClientInsert = new EntityServiceReference.EntityServiceClient();
                    ServiceClientInsert.Open();
                    var confirm = ServiceClientInsert.registeruserwithoutpayment(WebMemberId, RdGender.SelectedValue.ToString(), txtFirstName.Text.ToString(), txtLastName.Text.ToString(), txtAddress.Text.ToString(), txtAddress.Text.ToString(), txtCity.Text.ToString(), txtCountry.Text.ToString(), txtMobileNo.Text.ToString(), txtMobileNo.Text.ToString(), txtEmailId.Text.ToString(), dtdob, dtdoa, RdMartialStatus.SelectedValue.ToString(), Gender, paidamount, DateTime.Now, "0", "-", txtEmailId.Text.ToString(), txtPassword.Text.ToString(), txtDesignation.Text.ToString(), false, false);
                    if (confirm.Length > 0)
                    {
                        WebMemberId = confirm[0].tempwebid.Value.ToString();
                        //****************this is used to trace the useer redirect from mailer*********************
                        #region for update Royal_MailerTracker
                        string str = "update [dbo].[Royal_MailerTracker] set Name='" + txtFirstName.Text + "',EMail='" + txtEmailId.Text + "',WebID=" + WebMemberId + ",MobileNo='" + txtMobileNo.Text + "' where ID=" + Convert.ToInt64(Session["mailerid"].ToString());
                        SqlCommand scmd = new SqlCommand(str, con);
                        try
                        {
                            con.Open();
                            scmd.ExecuteNonQuery();
                        }
                        catch (SqlException ex)
                        {
                        }
                        finally
                        {
                            con.Close();
                        }
                        #endregion for update Royal_MailerTracker
                        //**********************************************************************************************
                        HTMLSignUpMailer(WebMemberId);
                        if (Convert.ToInt32(WebMemberId) > 0)
                        {
                            grayBG.Visible = true;
                            showcontainer.Visible = true;
                            Container.Visible = true;
                            lb_digitalmsg.Visible = true;
                            lb_digitalmsg.Text = "Enrollment No: " + WebMemberId + "" + "<br/> Thank you for Registering with us. Please collect your card from loyalty helpdesk.";
                            ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript: digital_kaos(); ", true);
                        }
                    }
                    ServiceClientInsert.Close();
                    ServiceClientInsert1.Close();
                    ServiceClientInsert2.Close();
                }
            }
            catch (Exception ex)
            {
                LblMsg.Text = ex.Message;
            }
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            String WebMemberId = "";

            // get max id
            try
            {
                EntityServiceReference.EntityServiceClient ServiceClientInsert2 = new EntityServiceReference.EntityServiceClient();
                ServiceClientInsert2.Open();
                var MobileNo = ServiceClientInsert2.MobilenoExist(txtMobileNo.Text.ToString());

                EntityServiceReference.EntityServiceClient ServiceClientInsert1 = new EntityServiceReference.EntityServiceClient();
                ServiceClientInsert1.Open();
                var emailconfirm = ServiceClientInsert1.EmailExists(txtEmailId.Text.ToString());
                if (emailconfirm > 0)
                {
                    ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('Email Already Exist..!!');", true);
                }
                else if (MobileNo > 0)
                {
                    ClientScript.RegisterStartupScript(typeof(Page), "test", "alert('MobileNo. Already Exist..!!');", true);
                }
                else
                {
                    DateTime dtdoa;
                    String   Dob   = ddlmonth.SelectedValue.ToString() + "/" + ddlday.SelectedValue.ToString() + "/" + ddlyear.SelectedValue.ToString();
                    String   Doa   = DdlMonthAnniversary.SelectedValue.ToString() + "/" + DdlDayAnniversary.SelectedValue.ToString() + "/" + DdlYearAnniversary.SelectedValue.ToString();
                    DateTime dtdob = Convert.ToDateTime(Dob);
                    dtdoa = Convert.ToDateTime(Doa);
                    txtDesignation.Text = "";
                    txtPassword.Text    = "";
                    Decimal paidamount = Convert.ToDecimal(0.00);
                    if (RdGender.SelectedValue.ToString().Equals("Mr."))
                    {
                        Gender = "Male";
                    }
                    else
                    {
                        Gender = "Female";
                    }
                    if (RdMartialStatus.SelectedValue.ToString().Equals("Married"))
                    {
                        dtdoa = Convert.ToDateTime(Doa);
                    }
                    else
                    {
                        dtdoa = DateTime.Parse("01/01/1753");
                    }
                    EntityServiceReference.EntityServiceClient ServiceClientInsert = new EntityServiceReference.EntityServiceClient();
                    ServiceClientInsert.Open();
                    var confirm = ServiceClientInsert.registeruserwithoutpayment(WebMemberId, RdGender.SelectedValue.ToString(), txtFirstName.Text.ToString(), txtLastName.Text.ToString(), txtAddress.Text.ToString(), txtAddress.Text.ToString(), txtCity.Text.ToString(), txtCountry.Text.ToString(), txtMobileNo.Text.ToString(), txtMobileNo.Text.ToString(), txtEmailId.Text.ToString(), dtdob, dtdoa, RdMartialStatus.SelectedValue.ToString(), Gender, paidamount, DateTime.Now, "0", "-", txtEmailId.Text.ToString(), txtPassword.Text.ToString(), txtDesignation.Text.ToString(), false, false);
                    if (confirm.Length > 0)
                    {
                        WebMemberId = confirm[0].tempwebid.Value.ToString();
                        //****************this is used to trace the useer redirect from mailer*********************
                        #region for update Royal_MailerTracker
                        string     str  = "update [dbo].[Royal_MailerTracker] set Name='" + txtFirstName.Text + "',EMail='" + txtEmailId.Text + "',WebID=" + WebMemberId + ",MobileNo='" + txtMobileNo.Text + "' where ID=" + Convert.ToInt64(Session["mailerid"].ToString());
                        SqlCommand scmd = new SqlCommand(str, con);
                        try
                        {
                            con.Open();
                            scmd.ExecuteNonQuery();
                        }
                        catch (SqlException ex)
                        {
                        }
                        finally
                        {
                            con.Close();
                        }
                        #endregion for update Royal_MailerTracker
                        //**********************************************************************************************
                        HTMLSignUpMailer(WebMemberId);
                        if (Convert.ToInt32(WebMemberId) > 0)
                        {
                            grayBG.Visible        = true;
                            showcontainer.Visible = true;
                            Container.Visible     = true;
                            lb_digitalmsg.Visible = true;
                            lb_digitalmsg.Text    = "Enrollment No: " + WebMemberId + "" + "<br/> Thank you for Registering with us. Please collect your card from loyalty helpdesk.";
                            ClientScript.RegisterStartupScript(GetType(), "Javascript", "javascript: digital_kaos(); ", true);
                        }
                    }
                    ServiceClientInsert.Close();
                    ServiceClientInsert1.Close();
                    ServiceClientInsert2.Close();
                }
            }
            catch (Exception ex)
            {
                LblMsg.Text = ex.Message;
            }
        }