public object GenerateUser(JsonMember.UserDetails obj) { registrationReturn obj1 = new registrationReturn(); try { Sqldbmanager.Open(); Sqldbmanager.CreateParameters(5); Sqldbmanager.AddParameters(0, "@Name", obj.Name); Sqldbmanager.AddParameters(1, "@UserName", obj.UserName); Sqldbmanager.AddParameters(2, "@UserPassword", obj.Password); Sqldbmanager.AddParameters(3, "@EmailId", obj.EmailId); Sqldbmanager.AddParameters(4, "@MobileNo", obj.MobileNo); DS = Sqldbmanager.ExecuteDataSet(CommandType.StoredProcedure, "USP_GenerateUser"); if (Convert.ToBoolean(DS.Tables[0].Rows[0]["flag"]) == true) { objEMail.SendSMSbyTillio(obj.MobileNo, "Flipprr Verification Code " + DS.Tables[0].Rows[0]["OTP"].ToString()); //Thread thrdSms = new Thread(() => SmsResult = (new Email()).SendSMS(obj.MobileNo, DS.Tables[0].Rows[0]["OTP"].ToString() + " is your flipprr verification code.")); //thrdSms.Start(); //Thread thrdMail = new Thread(() => MailResult = (new Email()).sendMail(obj.EmailId, "", "Flipprr Verification Code", DS.Tables[0].Rows[0]["OTP"].ToString(), "")); //thrdMail.Start(); } obj1 = new registrationReturn() { flag = DS.Tables[0].Rows[0]["flag"].ToString(), Message = DS.Tables[0].Rows[0]["Message"].ToString(), OTPId = DS.Tables[0].Rows[0]["OTPId"].ToString(), OTP = DS.Tables[0].Rows[0]["OTP"].ToString(), UserId = DS.Tables[0].Rows[0]["UserId"].ToString() }; } catch (Exception Ex) { DS = LogError("Generate User", Ex.Message.ToString(), "SP Name: USP_GenerateUser"); obj1 = new registrationReturn() { flag = "false", Message = DS.Tables[0].Rows[0]["Meaasge"].ToString(), OTPId = "", OTP = "", UserId = "" }; } finally { Sqldbmanager.Close(); } return(obj1); }
public object ForgetPassword(JsonMember.UserDetails obj) { registrationReturn obj1 = new registrationReturn(); try { Sqldbmanager.Open(); Sqldbmanager.CreateParameters(1); Sqldbmanager.AddParameters(0, "@LoginId", obj.LoginId); DS = Sqldbmanager.ExecuteDataSet(CommandType.StoredProcedure, "usp_ForgetPassword"); if (Convert.ToBoolean(DS.Tables[0].Rows[0]["flag"]) == true) { //objEMail.SendSMS(obj.MobileNo, DS.Tables[0].Rows[0]["MobileNo"].ToString() + " is your flipprr verification code."); objEMail.SendSMSbyTillio(DS.Tables[0].Rows[0]["MobileNo"].ToString(), "Flipprr Verification Code " + DS.Tables[0].Rows[0]["OTP"].ToString()); } obj1 = new registrationReturn() { flag = DS.Tables[0].Rows[0]["flag"].ToString(), Message = DS.Tables[0].Rows[0]["Message"].ToString(), OTPId = DS.Tables[0].Rows[0]["OTPId"].ToString(), OTP = DS.Tables[0].Rows[0]["OTP"].ToString(), UserId = DS.Tables[0].Rows[0]["UserId"].ToString() }; } catch (Exception Ex) { DS = LogError("Forget Password", Ex.Message.ToString(), "SP Name: usp_ForgetPassword"); obj1 = new registrationReturn() { flag = "false", Message = DS.Tables[0].Rows[0]["Meaasge"].ToString(), OTPId = "", OTP = "", UserId = "" }; } finally { Sqldbmanager.Close(); } return(obj1); }
public object ChangePassword(JsonMember.UserDetails obj) { registrationReturn obj1 = new registrationReturn(); try { Sqldbmanager.Open(); Sqldbmanager.CreateParameters(4); Sqldbmanager.AddParameters(0, "@UserId", obj.UserId); Sqldbmanager.AddParameters(1, "@OTPId", obj.OTPId); Sqldbmanager.AddParameters(2, "@OTP", obj.OTP); Sqldbmanager.AddParameters(3, "@UserPassword", obj.Password); DS = Sqldbmanager.ExecuteDataSet(CommandType.StoredProcedure, "USP_ChangePassword"); obj1 = new registrationReturn() { flag = DS.Tables[0].Rows[0]["flag"].ToString(), Message = DS.Tables[0].Rows[0]["Message"].ToString(), OTPId = "", OTP = "", UserId = DS.Tables[0].Rows[0]["UserId"].ToString() }; } catch (Exception Ex) { DS = LogError("Change Password", Ex.Message.ToString(), "SP Name: USP_ChangePassword"); obj1 = new registrationReturn() { flag = "false", Message = DS.Tables[0].Rows[0]["Meaasge"].ToString(), OTPId = "", OTP = "", UserId = "" }; } finally { Sqldbmanager.Close(); } return(obj1); }