public HttpResponseMessage CheckForgetLink(ForgetCls model)
        {
            try
            {
                DataSet        ds   = null;
                MailRepository mail = new MailRepository();

                ds = blObj.LinkCheck(model);
                APIResponse response = new APIResponse();

                response.ResponseCode = ds.Tables[0].Rows[0]["StatusCode"].ToString();
                if (ds.Tables[0].Rows[0]["StatusCode"].ToString() == "200")
                {
                    response.ResponseMessage = ds.Tables[0].Rows[0]["EmailID"].ToString();
                }
                else
                {
                    response.ResponseMessage = ds.Tables[0].Rows[0]["Message"].ToString();
                }

                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex));
            }
        }
Exemple #2
0
        public DataSet ChangePassword(ForgetCls _ur)
        {
            DataSet dt = new DataSet();

            try
            {
                SqlConnection con = new SqlConnection(conStr);
                SqlCommand    cmd = new SqlCommand("sp_forgetpassword", con);
                cmd.CommandType = CommandType.StoredProcedure;

                cmd.Parameters.AddWithValue("@i_userid", _ur.userid);
                cmd.Parameters.AddWithValue("@i_pwd", _ur.password);
                cmd.Parameters.AddWithValue("@i_type", _ur.usertype);
                cmd.Parameters.AddWithValue("@i_newpwd", _ur.newpassword);
                con.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);
                con.Close();
            }
            catch (Exception ex)
            {
                dt = null;
            }
            return(dt);
        }
 public HttpResponseMessage ChangePassword(ForgetCls model)
 {
     try
     {
         DataSet ds = null;
         ds = blObj.ChangePassword(model);
         APIResponse response = new APIResponse();
         response.ResponseCode    = ds.Tables[0].Rows[0]["StatusCode"].ToString();
         response.ResponseMessage = ds.Tables[0].Rows[0]["Message"].ToString();
         return(Request.CreateResponse(HttpStatusCode.OK, response));
     }
     catch (Exception ex)
     {
         return(Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex));
     }
 }
        public HttpResponseMessage ForgetPassword(ForgetCls model)
        {
            try
            {
                DataSet ds = null;

                ds = blObj.ForgetPassword(model);
                APIResponse response = new APIResponse();
                if (ds.Tables[0].Rows[0]["StatusCode"].ToString() == "200")
                {
                    string linkdata = ds.Tables[0].Rows[0]["UUID"].ToString();
                    mail.forgetmail(linkdata, model.userid, ds.Tables[0].Rows[0]["ID"].ToString());
                }
                response.ResponseCode    = ds.Tables[0].Rows[0]["StatusCode"].ToString();
                response.ResponseMessage = ds.Tables[0].Rows[0]["Message"].ToString();
                return(Request.CreateResponse(HttpStatusCode.OK, response));
            }
            catch (Exception ex)
            {
                return(Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex));
            }
        }
Exemple #5
0
        public DataSet LinkCheck(ForgetCls _ur)
        {
            DataSet dt = new DataSet();

            try
            {
                SqlConnection con = new SqlConnection(conStr);
                SqlCommand    cmd = new SqlCommand("SP_CheckLink", con);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@i_id", _ur.userid);
                cmd.Parameters.AddWithValue("@i_uuid", _ur.UUID);
                con.Open();
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(dt);
                con.Close();
            }
            catch (Exception ex)
            {
                dt = null;
            }
            return(dt);
        }