Пример #1
0
        void registrationcode()
        {
            try
            {
                var q = objlayer.checkifmailorcontactexist(txtemail.Value, Convert.ToInt64(txtcontact.Value));

                if (q.Any())
                {
                    lblmsg.Text = "Email Or Contact Already Exists.Please Try With Another Contact Or Email";
                    lblmsg.Attributes.Add("style", "color:red");
                }
                else
                {
                    if (txtpassword.Value == txtcnfpassword.Value)
                    {
                        reg.RegNo     = Convert.ToString(hdfapp.Value);
                        reg.Name      = txtname.Value;
                        reg.Password  = txtpassword.Value;
                        reg.ContactNo = Convert.ToInt64(txtcontact.Value);
                        reg.Email     = txtemail.Value;
                        int Issuccessfull = InsertionLayer.userregistration(reg);
                        if (Issuccessfull == 1)
                        {
                            lblmsg.Text  = "Registration Was Successfull.Once Registration Approved You can login Into Profile.";
                            lblmsg1.Text = "Your Registration Number Is " + hdfapp.Value + "Keep It For Future Reference.";
                            lblmsg.Attributes.Add("style", "color:green");
                            txtname.Value        = "";
                            txtpassword.Value    = "";
                            txtemail.Value       = "";
                            txtcontact.Value     = "";
                            txtcnfpassword.Value = "";
                        }
                        else
                        {
                            lblmsg.Text = "Technical Error.Try After Sometime";
                            lblmsg.Attributes.Add("style", "color:red");
                        }
                    }
                    else
                    {
                        lblmsg.Text = "Password Do Not Match";
                        lblmsg.Attributes.Add("style", "color:red");
                    }
                }
            }
            catch (Exception ex)
            {
                lblmsg.Text = ex.Message;
                lblmsg.Attributes.Add("style", "color:red");
            }
        }