public ActionResult ChangeRequest(FormCollection Form) { string content = Form.Get("request-content"); var db = new PremierEntities(); try { var rs = db.xp_client_profile_requestchange(this.MemberISN, content); TempData["success"] = "Your request has been sent."; } catch { TempData["error"] = "Change request error."; } return RedirectToAction("MyProfile"); }
public void GetMyProfile(int MemberISN) { var db = new PremierEntities(); //var userInfos = db.xp_debtuser_getinfo(MemberISN); //var userInfo = userInfos.FirstOrDefault(); var query = "xp_debtuser_getinfo"; var parameters = new Hashtable(); parameters.Add("MemberISN", MemberISN); var dataProvider = new DataProvider(); var rsInt = 0; var ds = dataProvider.ExecuteStoreProcedure(query, parameters, out rsInt ) ; try { this.UserName = ds.Tables[0].Rows[0]["memUserName"].ToString(); this.LastRequest = GetLastRequest(MemberISN); this.FirstName = ds.Tables[0].Rows[0]["memFirstName"].ToString(); this.LastName = ds.Tables[0].Rows[0]["memLastName"].ToString(); this.HomePhone = ds.Tables[0].Rows[0]["memHomePhone"].ToString(); this.WorkPhone = ds.Tables[0].Rows[0]["memWorkPhone"].ToString(); this.CellPhone = ds.Tables[0].Rows[0]["memPhone"].ToString(); this.FaxNumber = ds.Tables[0].Rows[0]["memFax"].ToString(); this.ClientID = ds.Tables[0].Rows[0]["memFax"].ToString(); this.Email = ds.Tables[0].Rows[0]["memEmail"].ToString(); this.DealerISN = Convert.ToInt32(ds.Tables[0].Rows[0]["DealerISN"]); var attrRow = ds.Tables[1].Select("attID = 'BestTimeOfCall'"); this.BestTimeToContact = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'MarriedStatus'"); this._Married = attrRow.Length == 0 ? -1 : Convert.ToInt32(attrRow[0]["attValue"]); this.Address = ds.Tables[0].Rows[0]["memAddress"].ToString(); this.City = ds.Tables[0].Rows[0]["memCity"].ToString(); this._State = ds.Tables[0].Rows[0]["memState"].ToString(); this.Zip = ds.Tables[0].Rows[0]["memZip"].ToString(); attrRow = ds.Tables[1].Select("attID = 'Language'"); this.Language = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'CoFirstName'"); this.CoFirstName = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'CoLastName'"); this.CoLastName = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'CoAddress'"); this.CoAddress = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'CoCity'"); this.CoCity = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'CoState'"); this._CoState = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'CoZip'"); this.CoZip = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'CoEmail'"); this.CoEmail = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'IsCoClient'"); this.IsCoClient = attrRow.Length == 0 ? string.Empty : attrRow[0]["attValue"].ToString(); attrRow = ds.Tables[1].Select("attID = 'ClientRequiredMFALogin'"); this.IsMFARequired = attrRow.Length == 0 ? true : Convert.ToBoolean(attrRow[0]["attValue"]); } catch (Exception ex) { StatusGetData = ex.ToString(); } }
public MessageController() { db = new PremierEntities(); }