public List<ChangePasswordExt> GetUserDetails(Controller Ctrl, string CurrentPassword, string NewPassword, string Verification) { string Pass = ""; List<ChangePasswordExt> list = new List<ChangePasswordExt>(); DataSet ds = new DataSet(); DataTable dt = new DataTable(); SQLCon.Open(); SqlCommand cmd = new SqlCommand("BizSp_GetUsers", SQLCon); cmd.Parameters.AddWithValue("@Culture", CultureValue); cmd.Parameters.AddWithValue("@OrderBy", "ID"); cmd.Parameters.AddWithValue("@PagingSize", 1); cmd.Parameters.AddWithValue("@PageIndex", 1); cmd.Parameters.AddWithValue("@UserID", Convert.ToInt64(Ctrl.Session["UserID"])); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(ds); if (ds != null) { dt = ds.Tables[1]; } SQLCon.Close(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { ChangePasswordExt EmailObj = new ChangePasswordExt(); Pass = dr["Password"].ToString(); string Decryptedoperations = Decrypt128New(Pass); EmailObj.Password = Decryptedoperations; Pass = EmailObj.Password; EmailObj.EmailID = dr["Email"].ToString(); EmailObj.Username = dr["UserName"].ToString(); list.Add(EmailObj); } } return list; }
public List<ChangePasswordExt> GetCode() { List<ChangePasswordExt> list = new List<ChangePasswordExt>(); string code = "PasswordLength"; DataTable dt = new DataTable(); SQLCon.Open(); SqlCommand cmd = new SqlCommand("B_Ex_GetContactUs_BizTbl_Parameter_SP", SQLCon); cmd.Parameters.AddWithValue("@code", code); cmd.CommandType = CommandType.StoredProcedure; SqlDataAdapter sda = new SqlDataAdapter(cmd); sda.Fill(dt); SQLCon.Close(); if (dt.Rows.Count > 0) { foreach (DataRow dr in dt.Rows) { ChangePasswordExt EmailObj = new ChangePasswordExt(); EmailObj.PasswordLen = dr["value"].ToString(); EmailObj.Valid ="^.*(?=.{" + EmailObj.PasswordLen + ",})(?=.*d)(?=.*[a-zA-Z]).*$"; list.Add(EmailObj); } } return list; }