public async Task <ActionResult> ChangePassword(SettingViewMode model) { //var result; if (!ModelState.IsValid) { return(View(model)); } var userId = UserId.Value.ToString(); //catch (Exception ex) { } var result = await UserManager.ChangePasswordAsync(userId, model.cp.OldPassword, model.cp.NewPassword); if (result.Succeeded) { var user = await UserManager.FindByIdAsync(User.Identity.GetUserId()); if (user != null) { await SignInManager.SignInAsync(user, isPersistent : false, rememberBrowser : false); } ModelState.Clear(); ViewBag.Country = Session["Country"]; ViewBag.StatusMessage = "Your password has been changed."; return(View("~/Views/Settings/Settings.cshtml", model)); // return RedirectToAction("Index", new { Message = ManageMessageId.ChangePasswordSuccess }); } ViewBag.Country = Session["Country"]; AddErrors(result); return(View("Settings", model)); }
private SettingMetaSource[] GetAllowedSettingIdMetaSourcesForViewMode(SettingViewMode viewMode) { switch (viewMode) { case SettingViewMode.CustomSettingsOnly: return(new[] { SettingMetaSource.CustomSettings }); case SettingViewMode.IncludeScannedSetttings: return(new[] { SettingMetaSource.ConstantSettings, SettingMetaSource.ScannedSettings, SettingMetaSource.CustomSettings, SettingMetaSource.DriverSettings, SettingMetaSource.ReferenceSettings, }); default: return(new[] { SettingMetaSource.CustomSettings, SettingMetaSource.DriverSettings, }); } }
public IHttpActionResult PostSaveEmailNotification(SettingViewMode obj) { if (con.State == ConnectionState.Open) { con.Close(); } con.Open(); SqlCommand cmd1 = new SqlCommand("SP_SaveEmailNotification", con); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@UserId", obj.En.UserId); cmd1.Parameters.AddWithValue("@Send", obj.En.send); cmd1.Parameters.AddWithValue("@Receive", obj.En.Receive); cmd1.Parameters.AddWithValue("@Buy", obj.En.Buy); cmd1.Parameters.AddWithValue("@Sell", obj.En.Sell); cmd1.Parameters.AddWithValue("@Exchange", obj.En.Exchange); cmd1.Parameters.AddWithValue("@TransactionDate", System.DateTime.Now); int Result = cmd1.ExecuteNonQuery(); con.Close(); if (Result != 0) { return(Ok("Email Notification Saved Successfully")); } else { return(Ok("Record not saved , Try again..")); } }
private SettingMeta PostProcessMeta(uint settingId, SettingMeta settingMeta, SettingViewMode viewMode) { var newMeta = new SettingMeta() { DefaultDwordValue = settingMeta.DefaultDwordValue, DefaultStringValue = settingMeta.DefaultStringValue, SettingName = settingMeta.SettingName, SettingType = settingMeta.SettingType, GroupName = settingMeta.GroupName, }; if (string.IsNullOrEmpty(newMeta.SettingName)) { newMeta.SettingName = string.Format("0x{0:X8}", settingId); } var allowedSourcesForViewMode = GetAllowedSettingValueMetaSourcesForViewMode(viewMode); if (settingMeta.DwordValues != null) { newMeta.DwordValues = settingMeta.DwordValues .Where(x => allowedSourcesForViewMode.Contains(x.ValueSource)).ToList(); } if (settingMeta.StringValues != null) { newMeta.StringValues = settingMeta.StringValues .Where(x => allowedSourcesForViewMode.Contains(x.ValueSource)).ToList(); } return(newMeta); }
public new ActionResult Profile(SettingViewMode obj) { if (!ModelState.IsValid) { try { ViewBag.BTC = "$" + Math.Round(Convert.ToDecimal(objCoin.BTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round(Convert.ToDecimal(objCoin.ETHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round(Convert.ToDecimal(objCoin.DASHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round(Convert.ToDecimal(objCoin.LTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round(Convert.ToDecimal(objCoin.ETCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round(Convert.ToDecimal(objCoin.GetMBC_USDCoin()), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } ViewBag.Country = Session["Country"]; return(View("Settings", obj)); } var re = ModelState.Values; var userId = User.Identity.GetUserId(); obj.profile.UserId = userId; using (var client = new HttpClient()) { client.BaseAddress = new Uri(url + "Transaction/Profile"); //HTTP POST var postTask = client.PostAsJsonAsync(url + "Transaction/Profile", obj); postTask.Wait(); var result = postTask.Result; if (result.IsSuccessStatusCode) { TempData["success"] = "Profile has been updated....!"; ModelState.Clear(); return(RedirectToAction("Settings")); } else { ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator."); } } // ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator."); ViewBag.Country = Session["Country"]; try { ViewBag.BTC = "$" + Math.Round(Convert.ToDecimal(objCoin.BTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round(Convert.ToDecimal(objCoin.ETHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round(Convert.ToDecimal(objCoin.DASHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round(Convert.ToDecimal(objCoin.LTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round(Convert.ToDecimal(objCoin.ETCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round(Convert.ToDecimal(objCoin.GetMBC_USDCoin()), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } return(View("Settings", obj)); }
public SettingMeta GetSettingMeta(uint settingId, SettingViewMode viewMode = SettingViewMode.Normal) { if (settingMetaCache.ContainsKey(settingId)) { return(PostProcessMeta(settingId, settingMetaCache[settingId], viewMode)); } else { var settingMeta = CreateSettingMeta(settingId); settingMetaCache.Add(settingId, settingMeta); return(PostProcessMeta(settingId, settingMeta, viewMode)); } }
public List <uint> GetSettingIds(SettingViewMode viewMode) { var settingIds = new List <uint>(); var allowedSourcesForViewMode = GetAllowedSettingIdMetaSourcesForViewMode(viewMode); foreach (var service in MetaServices.OrderBy(x => x.Service.Source)) { if (allowedSourcesForViewMode.Contains(service.Service.Source)) { settingIds.AddRange(service.Service.GetSettingIds()); } } return(settingIds.Distinct().ToList()); }
public List <SettingItem> GetSettingsForProfile(string profileName, SettingViewMode viewMode, ref Dictionary <string, string> applications) { var result = new List <SettingItem>(); var settingIds = meta.GetSettingIds(viewMode); settingIds.AddRange(_baseProfileSettingIds); settingIds = settingIds.Distinct().ToList(); applications = DrsSession((hSession) => { var hProfile = GetProfileHandle(hSession, profileName); var profileSettings = GetProfileSettings(hSession, hProfile); foreach (var profileSetting in profileSettings) { result.Add(CreateSettingItem(profileSetting)); if (settingIds.Contains(profileSetting.settingId)) { settingIds.Remove(profileSetting.settingId); } } foreach (var settingId in settingIds) { var setting = ReadSetting(hSession, hProfile, settingId); if (setting != null) { result.Add(CreateSettingItem(setting.Value)); } else { var dummySetting = new NVDRS_SETTING() { settingId = settingId }; result.Add(CreateSettingItem(dummySetting, true)); } } return(GetProfileApplications(hSession, hProfile) .Select(x => Tuple.Create(x.appName, GetApplicationFingerprint(x))).ToDictionary(x => x.Item2, x => x.Item1)); }); return(result.OrderBy(x => x.SettingText).ThenBy(x => x.GroupName).ToList()); }
public async Task <IHttpActionResult> ChangePassword(SettingViewMode model) { //string msg = ""; if (!ModelState.IsValid) { return(BadRequest(ModelState)); } ValueController obj = new ValueController(); // var userId = obj.GetUserId(); IdentityResult result = await UserManager.ChangePasswordAsync(model.cp.UserId, model.cp.OldPassword, model.cp.NewPassword); if (!result.Succeeded) { // BadRequestErrorMessageResult re = new BadRequestErrorMessageResult(); // var res=GetErrorResult(result); //return BadRequest(res.ToString()); return(GetErrorResult(result)); //return BadRequest((result.); //if (result.Errors != null) //{ // foreach (string error in result.Errors) // { // // ModelState.AddModelError("", error); // msg = error; // } // return BadRequest(msg); //} //if (result == null) //{ // return InternalServerError(); //} // return BadRequest(msg); } return(Ok()); }
//public IHttpActionResult GetSavePersonalDetails(Guid UserId, string FirstName, string LastName, DateTime Registration_Date, string City, string Country, string ContactNumber, DateTime DateOfBirth, string Address, string Status) public IHttpActionResult PostSavePersonalDetails(SettingViewMode obj) { if (con.State == ConnectionState.Open) { con.Close(); } string address = obj.profile.DoorNo + "," + obj.profile.Address1 + "," + obj.profile.Address2 + "," + obj.profile.Zipcode; con.Open(); SqlCommand cmd1 = new SqlCommand("SP_PersonalDetails", con); cmd1.CommandType = CommandType.StoredProcedure; cmd1.Parameters.AddWithValue("@UserId", obj.profile.UserId); cmd1.Parameters.AddWithValue("@FirstName", obj.profile.Fname); cmd1.Parameters.AddWithValue("@MiddleName", obj.profile.Mname); cmd1.Parameters.AddWithValue("@LastName", obj.profile.Lname); cmd1.Parameters.AddWithValue("@Nationality", obj.profile.Nationality); cmd1.Parameters.AddWithValue("@Registration_Date", System.DateTime.Now); cmd1.Parameters.AddWithValue("@Country", obj.profile.Country); cmd1.Parameters.AddWithValue("@State", obj.profile.State); cmd1.Parameters.AddWithValue("@City", obj.profile.City); cmd1.Parameters.AddWithValue("@ContactNumber", "123456"); cmd1.Parameters.AddWithValue("@DateOfBirth", obj.profile.DOB); cmd1.Parameters.AddWithValue("@Address", address); cmd1.Parameters.AddWithValue("@Status", "Active"); int Result = cmd1.ExecuteNonQuery(); con.Close(); if (Result != 0) { return(Ok("Personal Details Saved Successfully")); } else { return(Ok("Record not saved , Try again..")); } }
public async Task <ActionResult> ChangePassword(SettingViewMode obj) { if (!ModelState.IsValid) { var d = CoinsMarketValueController.GetMarkupWithCoinId(); foreach (var r in d) { switch (r.Key) { case 101: mark101 = r.Value; break; case 102: mark102 = r.Value; break; case 103: mark103 = r.Value; break; case 104: mark104 = r.Value; break; case 105: mark105 = r.Value; break; case 106: mark106 = r.Value; break; } } try { ViewBag.BTC = "$" + Math.Round((Convert.ToDecimal(objCoin.BTCCurrentPrice()) + Convert.ToDecimal(mark101)), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round((Convert.ToDecimal(objCoin.ETHCurrentPrice()) + Convert.ToDecimal(mark106)), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round((Convert.ToDecimal(objCoin.DASHCurrentPrice()) + Convert.ToDecimal(mark102)), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round((Convert.ToDecimal(objCoin.LTCCurrentPrice()) + Convert.ToDecimal(mark103)), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round((Convert.ToDecimal(objCoin.ETCCurrentPrice()) + Convert.ToDecimal(mark105)), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round((Convert.ToDecimal(objCoin.GetMBC_USDCoin()) + Convert.ToDecimal(mark104)), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } ViewBag.Country = Session["Country"]; return(View("Settings", obj)); } var userId = User.Identity.GetUserId(); obj.cp.UserId = userId; using (client) { HttpResponseMessage responseMessage = await client.PostAsJsonAsync(url + "User/" + "ChangePassword", obj); if (responseMessage.IsSuccessStatusCode) { SettingViewMode obj1 = new SettingViewMode(); obj1.cp = new ChangePasswordViewModel(); ViewBag.Country = Session["Country"]; ViewBag.StatusMessage = "Your password has been changed."; var d2 = CoinsMarketValueController.GetMarkupWithCoinId(); foreach (var r in d2) { switch (r.Key) { case 101: mark101 = r.Value; break; case 102: mark102 = r.Value; break; case 103: mark103 = r.Value; break; case 104: mark104 = r.Value; break; case 105: mark105 = r.Value; break; case 106: mark106 = r.Value; break; } } try { ViewBag.BTC = "$" + Math.Round((Convert.ToDecimal(objCoin.BTCCurrentPrice()) + Convert.ToDecimal(mark101)), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round((Convert.ToDecimal(objCoin.ETHCurrentPrice()) + Convert.ToDecimal(mark106)), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round((Convert.ToDecimal(objCoin.DASHCurrentPrice()) + Convert.ToDecimal(mark102)), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round((Convert.ToDecimal(objCoin.LTCCurrentPrice()) + Convert.ToDecimal(mark103)), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round((Convert.ToDecimal(objCoin.ETCCurrentPrice()) + Convert.ToDecimal(mark105)), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round((Convert.ToDecimal(objCoin.GetMBC_USDCoin()) + Convert.ToDecimal(mark104)), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } return(View("Settings", obj1)); } else { string msg = UserController.getmsg; if (msg != null) { ModelState.AddModelError("ch", msg); } // ModelState.AddModelError("Change", "Server Error. Please contact administrator."); } var d = CoinsMarketValueController.GetMarkupWithCoinId(); foreach (var r in d) { switch (r.Key) { case 101: mark101 = r.Value; break; case 102: mark102 = r.Value; break; case 103: mark103 = r.Value; break; case 104: mark104 = r.Value; break; case 105: mark105 = r.Value; break; case 106: mark106 = r.Value; break; } } try { ViewBag.BTC = "$" + Math.Round((Convert.ToDecimal(objCoin.BTCCurrentPrice()) + Convert.ToDecimal(mark101)), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round((Convert.ToDecimal(objCoin.ETHCurrentPrice()) + Convert.ToDecimal(mark106)), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round((Convert.ToDecimal(objCoin.DASHCurrentPrice()) + Convert.ToDecimal(mark102)), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round((Convert.ToDecimal(objCoin.LTCCurrentPrice()) + Convert.ToDecimal(mark103)), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round((Convert.ToDecimal(objCoin.ETCCurrentPrice()) + Convert.ToDecimal(mark105)), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round((Convert.ToDecimal(objCoin.GetMBC_USDCoin()) + Convert.ToDecimal(mark104)), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } ViewBag.Country = Session["Country"]; return(View("Settings", obj)); } }
public ActionResult SessionTimeout(SettingViewMode obj) { string time = obj.lg.LogoutTime; if (System.Web.HttpContext.Current.Session.Timeout > 0 && Session["UserName"] != null) { switch (time) { case "5 Min": Session.Timeout = 5; break; case "10 Min": Session.Timeout = 10; break; case "15 Min": Session.Timeout = 15; break; case "30 Min": Session.Timeout = 30; break; default: Session.Timeout = 20; break; } ViewBag.res = "You will logout after" + time; ViewBag.Country = Session["Country"]; var d1 = CoinsMarketValueController.GetMarkupWithCoinId(); foreach (var r in d1) { switch (r.Key) { case 101: mark101 = r.Value; break; case 102: mark102 = r.Value; break; case 103: mark103 = r.Value; break; case 104: mark104 = r.Value; break; case 105: mark105 = r.Value; break; case 106: mark106 = r.Value; break; } } try { ViewBag.BTC = "$" + Math.Round((Convert.ToDecimal(objCoin.BTCCurrentPrice()) + Convert.ToDecimal(mark101)), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round((Convert.ToDecimal(objCoin.ETHCurrentPrice()) + Convert.ToDecimal(mark106)), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round((Convert.ToDecimal(objCoin.DASHCurrentPrice()) + Convert.ToDecimal(mark102)), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round((Convert.ToDecimal(objCoin.LTCCurrentPrice()) + Convert.ToDecimal(mark103)), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round((Convert.ToDecimal(objCoin.ETCCurrentPrice()) + Convert.ToDecimal(mark105)), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round((Convert.ToDecimal(objCoin.GetMBC_USDCoin()) + Convert.ToDecimal(mark104)), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } return(View("Settings")); } ViewBag.Country = Session["Country"]; var d = CoinsMarketValueController.GetMarkupWithCoinId(); foreach (var r in d) { switch (r.Key) { case 101: mark101 = r.Value; break; case 102: mark102 = r.Value; break; case 103: mark103 = r.Value; break; case 104: mark104 = r.Value; break; case 105: mark105 = r.Value; break; case 106: mark106 = r.Value; break; } } try { ViewBag.BTC = "$" + Math.Round((Convert.ToDecimal(objCoin.BTCCurrentPrice()) + Convert.ToDecimal(mark101)), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round((Convert.ToDecimal(objCoin.ETHCurrentPrice()) + Convert.ToDecimal(mark106)), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round((Convert.ToDecimal(objCoin.DASHCurrentPrice()) + Convert.ToDecimal(mark102)), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round((Convert.ToDecimal(objCoin.LTCCurrentPrice()) + Convert.ToDecimal(mark103)), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round((Convert.ToDecimal(objCoin.ETCCurrentPrice()) + Convert.ToDecimal(mark105)), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round((Convert.ToDecimal(objCoin.GetMBC_USDCoin()) + Convert.ToDecimal(mark104)), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } return(View("Settings")); }
public ActionResult EmailNotification(SettingViewMode obj) { if (!ModelState.IsValid) { try { ViewBag.BTC = "$" + Math.Round(Convert.ToDecimal(objCoin.BTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round(Convert.ToDecimal(objCoin.ETHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round(Convert.ToDecimal(objCoin.DASHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round(Convert.ToDecimal(objCoin.LTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round(Convert.ToDecimal(objCoin.ETCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round(Convert.ToDecimal(objCoin.GetMBC_USDCoin()), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } ViewBag.Country = Session["Country"]; return(View("Settings", obj)); } var userId = User.Identity.GetUserId(); obj.En.UserId = userId; using (var client = new HttpClient()) { client.BaseAddress = new Uri(url + "Transaction/Email"); //HTTP POST var postTask = client.PostAsJsonAsync(url + "Transaction/Email", obj); postTask.Wait(); var result = postTask.Result; if (result.IsSuccessStatusCode) { //return RedirectToAction("Index"); Notification n = new Notification(); EmailNotification en = n.GetNotification(userId); Session["Notification"] = en; //ViewBag.msg = "Data Successfully Saved..!"; TempData["successEmail"] = "Notification has been updated....!"; //ModelState.Clear(); //ViewBag.Country = Session["Country"]; //return View("Settings"); return(RedirectToAction("Settings")); } //else //{ // ModelState.AddModelError("Email", "Server Error. Please contact administrator."); // //return RedirectToAction("Settings"); //} } ModelState.Clear(); ModelState.AddModelError(string.Empty, "Server Error. Please contact administrator."); ViewBag.Country = Session["Country"]; try { ViewBag.BTC = "$" + Math.Round(Convert.ToDecimal(objCoin.BTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.BTC = ex.Message; } try { ViewBag.ETH = "$" + Math.Round(Convert.ToDecimal(objCoin.ETHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETH = ex.Message; } try { ViewBag.DASH = "$" + Math.Round(Convert.ToDecimal(objCoin.DASHCurrentPrice()), 2); } catch (Exception ex) { ViewBag.DASH = ex.Message; } try { ViewBag.LTC = "$" + Math.Round(Convert.ToDecimal(objCoin.LTCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.LTC = ex.Message; } try { ViewBag.ETC = "$" + Math.Round(Convert.ToDecimal(objCoin.ETCCurrentPrice()), 2); } catch (Exception ex) { ViewBag.ETC = ex.Message; } try { ViewBag.MBC = "$" + Math.Round(Convert.ToDecimal(objCoin.GetMBC_USDCoin()), 2); } catch (Exception ex) { ViewBag.MBC = ex.Message; } return(View("Settings")); }