예제 #1
0
        protected void submit_txt_Click(object sender, EventArgs e)
        {
            RegisterUserTableAdapter RU = new RegisterUserTableAdapter();

            string fileName = Path.GetFileName(sign_fld.PostedFile.FileName);

            sign_fld.PostedFile.SaveAs(Server.MapPath("~/Signature/User/") + fileName);
            object Result = RU.RegisterUser(reg_txt.Text, name_txt.Text, course_txt.Text, dep_txt.Text, stud_txt.Text, "http://Permission-Portal.somee.com/Signature/User/" + fileName, email_txt.Text, pwdr_txt.Text);

            Boolean chk = Convert.ToBoolean(Result);

            if (chk == true)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Registration Success.');window.location='Index.aspx';", true);
            }
            else
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "popup", "alert('Registration failed.');window.location='Index.aspx';", true);
            }
        }
예제 #2
0
        public String RegisterCredentials([FromBody] Register Obj)
        {
            RegisterUserTableAdapter ru = new RegisterUserTableAdapter();
            object obj    = ru.RegisterUser(Obj.Name, Obj.LoginID, Obj.password, Obj.Email);
            String Status = obj.ToString();

            if (Status.Equals("true"))
            {
                String message = Request.CreateResponse(HttpStatusCode.Created).ToString();
                return(message);
            }
            else if (Status.Equals("exists"))
            {
                String message = Request.CreateErrorResponse(HttpStatusCode.Conflict, Obj.LoginID).ToString();
                return(message);
            }
            else
            {
                String message = Request.CreateErrorResponse(HttpStatusCode.InternalServerError, Obj.LoginID).ToString();
                return(message);
            }
        }