public ActionResult SaveEditInfo(userdata model) { var user = db.userdatas.Find(model.Id); if (user != null) { user.billing_address1 = model.billing_address1; user.billing_address2 = model.billing_address2; user.billing_country = model.billing_country; user.billing_email = model.billing_email; user.billing_name = model.billing_name; user.billing_phone = model.billing_phone; user.billing_poscode = model.billing_poscode; user.billing_state = model.billing_state; user.billing_suburb = model.billing_state; user.company_name = model.company_name; user.contact_email = model.contact_email; user.contact_phone = model.contact_phone; user.delivery_address1 = model.delivery_address1; user.delivery_address2 = model.delivery_address2; user.delivery_contry = model.delivery_contry; user.delivery_email = model.delivery_email; user.delivery_name = model.delivery_name; user.delivery_phone = model.delivery_phone; user.delivery_postcode = model.delivery_postcode; user.delivery_state = model.delivery_state; user.delivery_suburb = model.delivery_suburb; user.firstname = model.firstname; user.lasname = model.lasname; db.SaveChanges(); } return(RedirectToAction("Index")); }
public ActionResult Index() { BaseViewModel basemodel = new BaseViewModel(); if (Session["LogedInUser2"] != null) { userdata user = Session["LogedInUser2"] as userdata; } else { HttpCookie Username = new HttpCookie("Username"); Username = Request.Cookies["Username"]; HttpCookie Password = new HttpCookie("Password"); Password = Request.Cookies["Password"]; if (Username != null) { basemodel.username = Username.Value; } if (Password != null) { basemodel.pass = Password.Value; } } return(View(basemodel)); }
public ActionResult Create([Bind(Include = "userID,firstName,lastName,userEmail")] userdata userdata) { int xConvertID; string UserID; var Temp_UserID = db.userdatas.Max(x => x.userID); if (Temp_UserID == null) { UserID = "100001"; userdata.userID = UserID; } else { Int32.TryParse(Temp_UserID, out xConvertID); xConvertID = xConvertID + 1; UserID = xConvertID.ToString(); userdata.userID = UserID; } if (ModelState.IsValid) { db.userdatas.Add(userdata); db.SaveChanges(); Response.Write(@"<script language='javascript'>alert('Message: \n" + "Welcome! Your User ID is: " + UserID + "');</script>"); } return(View(userdata)); }
public ActionResult uber(userdata data) { string unam = data.name; ViewBag.name = unam; return(View()); }
public AllLoggedUserInfo() { user = new user(); user_role = new user_role(); userdata = new userdata(); role = new role(); }
public ActionResult Login(userdata ud) { UserLogin responce = new UserLogin(); try { string query = "Exec spLogin '" + ud.Email + "','" + ud.Password + "','UserLogin'"; DataSet ds = d.BindDataset(query); if (ds.Tables[0].Rows.Count > 0) { responce.Description = ds.Tables[0].Rows[0]["msg"].ToString(); if (responce.Description == "Failed") { responce.Description = "Username or Password incorrect!"; } else { Session["UName"] = ds.Tables[0].Rows[0]["Name"].ToString(); string val = Session["UName"].ToString(); Session["Username"] = ds.Tables[0].Rows[0]["Email"].ToString(); Session["LoginAs"] = "User"; responce.returnurl = "/Customer/UserAction/Appointment"; } } } catch (Exception e) { responce.Description = e.Message; } return(Json(responce)); }
private async void LoadingModel(object sender, DoWorkEventArgs e) { ud = new userdata(); try { using (me = new MedicalModel(ConfigurationManager.Connect())) { await me.Database.Connection.OpenAsync(); DetailsModifyMDataSet.UserID = (int)GlobalVM.GlobalM.AccountID; if (!GlobalVM.GlobalM.UserID.Equals(null)) { ud = me.userdata.Where(b => b.IdUD == GlobalVM.GlobalM.UserID).Single(); nonexist = false; } else { nonexist = true; } DetailsModifyMDataSet.FullGenderList = me.gender_fx.ToList(); DetailsModifyMDataSet.FullZipCodeList = me.zipcode_fx.ToList(); DetailsModifyMDataSet.FullSettlementList = me.settlement_fx.ToList(); DetailsModifyMDataSet.SettlementZipSwitch = me.settlementzipcode_st.ToList(); } workingConn = true; } catch (Exception ex) { Log.WriteException(ex); workingConn = false; } }
public ActionResult User_Details(userdata ud) { DataUtility du = new DataUtility(); User_Details responce = new User_Details(); try { string query = "Exec spCustomer '','" + ud.Email + "','','','','','','SelectByEmail'"; DataSet ds = du.BindDataset(query); List <userdata> lst = new List <userdata>(); if (ds.Tables[0].Rows.Count > 0) { userdata u = new userdata(); u.U_ID = int.Parse(ds.Tables[0].Rows[0]["U_id"].ToString()); u.Name = ds.Tables[0].Rows[0]["Name"].ToString(); u.Contact = ds.Tables[0].Rows[0]["Contact"].ToString(); u.Address = ds.Tables[0].Rows[0]["Address"].ToString(); u.Pin_Code = ds.Tables[0].Rows[0]["Pin_Code"].ToString(); u.Email = ds.Tables[0].Rows[0]["Email"].ToString(); lst.Add(u); responce.Data = lst; } } catch (Exception e) { responce.Description = e.Message; } return(Json(responce)); }
public ContentResult CustomerRegister(string email, string pass, string phone, string val) { string currentpage = Session["currentpage"] as string; if (val == GlobalVariables.verificationval.ToString()) { string json; using (var client = new WebClient()) { //json = client.DownloadString("http://supectco.com/webs/polytrade/php/grid/setuser.php?email=" + email + "&pass="******"&phone" + phone); // json = client.DownloadString("http://supectco.com/webs/textile/setuseraddressandphone.php?" + "phone=" + phone + "&address=" + address + "&name=" + name); json = client.DownloadString("http://supectco.com/webs/textile/setuser.php?pass="******"&email=" + email + "&phone=" + phone); } var log = JsonConvert.DeserializeObject <List <userdata> >(json); userdata user = new userdata(); if (log != null) { user = log[0]; if (user.ID != "2" && user.ID != "3") { Session["LogedInUser"] = user; return(Content(user.ID + "*" + currentpage)); } } return(Content("2" + "*" + currentpage)); } else { return(Content("5" + "*" + currentpage)); } }
public ActionResult DeleteConfirmed(string id) { userdata userdata = db.userdatas.Find(id); db.userdatas.Remove(userdata); db.SaveChanges(); return(RedirectToAction("View_Climbers")); }
public ActionResult Edit([Bind(Include = "userID,firstName,lastName,userEmail")] userdata userdata) { if (ModelState.IsValid) { db.Entry(userdata).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("View_Climbers")); } return(View(userdata)); }
public Boolean rateEvent(string username, int eventID, int rating) { try { userdata eventToRate = new userdata(); return(eventToRate.rateEvent(username, rating, eventID)); } catch { return(false); } }
public AllLoggedUserInfo(user tem) { user = new user(); user_role = new user_role(); userdata = new userdata(); veebdbEntities data = new veebdbEntities(); user = data.users.Where(m => m.Id == tem.Id).FirstOrDefault(); user_role = data.user_role.Where(m => m.userid == user.Id).FirstOrDefault(); userdata = data.userdatas.Where(m => m.userid == user.Id).FirstOrDefault(); role = data.roles.Where(m => m.Id == user_role.roleid).FirstOrDefault(); }
public ActionResult SaveSignup(user user) { user.status = "active"; user.createdate = DateTime.Now; user.updatedate = DateTime.Now; user.type = 1; user.discount = 0; db.users.Add(user); db.SaveChanges(); user_role ur = new user_role(); ur.userid = user.Id; ur.roleid = 6; ur.status = "active"; db.user_role.Add(ur); userdata ud = new userdata(); ud.userid = user.Id; db.userdatas.Add(ud); db.SaveChanges(); var t = SendTemplateEmail(user.email, user.email, "", "Email register success", 1); var tem = db.users.FirstOrDefault(m => m.username == user.username && m.password == user.password); if (tem != null) { Session["LoggedAccount"] = null; AllLoggedUserInfo userFullInfo = new AllLoggedUserInfo(tem); Session["LoggedAccount"] = userFullInfo; string decodedUrl = ""; if (!string.IsNullOrEmpty(Url.Action("AccountInfo", "Account", new { id = user.Id }))) { decodedUrl = Server.UrlDecode(Url.Action("AccountInfo", "Account", new { id = user.Id })); } if (decodedUrl != "" && !decodedUrl.Contains("Login")) { return(Redirect(decodedUrl)); } if (userFullInfo.role.RoleName == "super_admin") { return(RedirectToAction("Index", "Admin")); } else { return(RedirectToAction("Index", "Home")); } } else { return(RedirectToAction("Login", "Home", new { message = "Acount do not exist." })); } }
public static ValidationResult checkUsers(String userName) { UserDataDA ctlUserData = new UserDataDA(); userdata users = ctlUserData.checkExist(userName); if (users == null) { return(new ValidationResult(ConstantsMultiLanguageKey.E_EMAIL_100)); } else { return(null); } }
// GET: userdatas/Edit public ActionResult Edit(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } userdata userdata = db.userdatas.Find(id); if (userdata == null) { return(HttpNotFound()); } return(View(userdata)); }
public static ValidationResult checkUsersByID(int userID, out userdata objOut) { UserDataDA ctlUserData = new UserDataDA(); objOut = ctlUserData.checkExistByUserID(userID); if (objOut == null) { return(new ValidationResult(ConstantsMultiLanguageKey.E_EMAIL_100)); } else { return(null); } }
public ActionResult CustomerLogin(string pass, string ischecked, string phone) { string json; using (var client2 = new WebClient()) { json = client2.DownloadString("http://supectco.com/webs/liabello/Admin/getuserid.php?pass="******"&mobile=" + phone); } var log = JsonConvert.DeserializeObject <List <userdata> >(json); if (log != null) { userdata user = log[0]; if (user.ID != "") { Session["LogedInUser2"] = user; if (Request.Cookies["productcookiie"] != null) { HttpCookie currentUserCookie = Request.Cookies["productcookiie"]; Response.Cookies.Remove("productcookiie"); currentUserCookie.Expires = DateTime.Now.AddDays(-10); currentUserCookie.Value = null; Response.SetCookie(currentUserCookie); } if (ischecked == "checked") { HttpCookie Username = new HttpCookie("Username"); HttpCookie Password = new HttpCookie("Password"); DateTime now = DateTime.Now; Username.Value = phone; Username.Expires = now.AddMonths(1); Password.Value = pass; Password.Expires = now.AddMonths(1); Response.Cookies.Add(Username); Response.Cookies.Add(Password); } } return(Content("1/Admin/product")); } else { return(Content("2/Admin/product")); } }
public ActionResult signup(SOUND_SYSTEM.Model.userdata p) { userdata si = mdi.userdatas.Where(x => x.Username == p.Username).SingleOrDefault(); if (si == null) { mdi.userdatas.Add(p); mdi.SaveChanges(); Session["uname"] = p.Username; return(Redirect("/Home/Index")); } else { ViewBag.Error = "Username Already Exists ......"; return(View("signup")); } }
//view details on individuals public ActionResult Details(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } userdata userdata = db.userdatas.Find(id); ViewBag.Logs = db1.userLogs.Where(x => x.userID == id).ToList(); if (userdata == null) { return(HttpNotFound()); } return(View(userdata)); }
public ContentResult SetOrChangeAddress(string address) { userdata user = Session["LogedInUser"] as userdata; string id = user.ID; string json; using (var client = new WebClient()) { json = client.DownloadString("http://supectco.com/webs/shargh/setorchangeaddress.php?ID=" + id + "&address=" + address); } var log = JsonConvert.DeserializeObject <string>(json); if (log == "1") { user.address = address; Session["LogedInUser"] = user; } return(Content(log)); }
public ActionResult Sign_Up(userdata ud) { UserRegsiter responce = new UserRegsiter(); try { string query = "Exec spCustomer '','" + ud.Email + "','" + ud.Password + "','" + ud.Name + "','" + ud.Contact + "','" + ud.Address + "','" + ud.Pin_Code + "','Insert'"; DataSet ds = d.BindDataset(query); if (ds.Tables[0].Rows.Count > 0) { responce.Description = ds.Tables[0].Rows[0][0].ToString(); } else { responce.Description = "Something went wrong"; } } catch (Exception e) { responce.Description = e.Message; } return(Json(responce)); }
public ActionResult Validatesignin(SOUND_SYSTEM.Model.userdata p) { userdata si = mdi.userdatas.Where(x => x.Email == p.Email).SingleOrDefault(); if (si != null) { if ((si.Email == p.Email) && (si.Password == p.Password)) { Session["uname"] = p.Username; return(Redirect("/Admin/Index")); } else { ViewBag.Error = " Incorrect Username and Password"; return(View("login")); } } else { ViewBag.Error = " Incorrect Username and Password"; } return(View("login")); }
public ActionResult CreateUser(user user) { if (ModelState.IsValid) { user.status = "active"; user.createdate = DateTime.Now; user.updatedate = DateTime.Now; db.users.Add(user); db.SaveChanges(); user_role ur = new user_role(); ur.userid = user.Id; ur.roleid = 7; ur.status = "active"; db.user_role.Add(ur); userdata ud = new userdata(); ud.userid = user.Id; db.userdatas.Add(ud); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(user)); }
public userdataDB getAllUserData(string username) { userdata allusers = new userdata(); return(allusers.getUserData(username)); }
public Boolean login(string username, string password) { userdata check = new userdata(); return(check.checklogin(username, password)); }
public Boolean registerUser2(string username, string password, string firstName, string lastName, string[] interests) { userdata user = new userdata(); return(user.registerUser(username, firstName, lastName, password, interests)); }
public Boolean modifyUser(string username, string firstName, string lastName, string oldpassword, string password, string[] interests) { userdata user = new userdata(); return(user.modifyUser(username, firstName, lastName, oldpassword, password, interests)); }
public static string setplan(int currage, double anualincome, double monthlyexp, double assetcost, int assettime, double vacationcost, int vacationtime, double othercost, int othertime, int retireage, int life, string stat, string goals, int noofchild, string hospital, bool illness, int inflation, double investing, double stock, double knowledge, double risk, string childrensage, string childrenseducation, string childrensmarriage) { string res = "ok"; try { if (HttpContext.Current.Session["Name"] != null && HttpContext.Current.Session["Email"] != null && HttpContext.Current.Session["Mobile"] != null) { SqlHelper sqlHelper = new SqlHelper(); DataTable dt_assets = SqlHelper.ExecuteDataset(sqlHelper.conn, CommandType.Text, "select * from [dbo].[fp_Assets]").Tables[0]; DataTable dt_returns = SqlHelper.ExecuteDataset(sqlHelper.conn, CommandType.Text, "select * from [dbo].[fp_Returns]").Tables[0]; HttpContext.Current.Session["AssetTitles"] = dt_assets; HttpContext.Current.Session["returns"] = dt_returns; userdata objusr = new userdata(); objusr.currage = currage; objusr.anualincome = anualincome; objusr.monthlyexp = monthlyexp; objusr.assetcost = assetcost; objusr.assettime = assettime; objusr.vacationcost = vacationcost; objusr.vacationtime = vacationtime; objusr.othercost = othercost; objusr.othertime = othertime; objusr.retireage = retireage; objusr.life = life; objusr.stat = stat; objusr.goals = goals; objusr.noofchild = noofchild; objusr.hospital = hospital; objusr.illness = illness; objusr.inflation = inflation; objusr.investing = investing; objusr.stock = stock; objusr.knowledge = knowledge; objusr.risk = risk; objusr.childrensage = childrensage; objusr.childrenseducation = childrenseducation; objusr.childrensmarriage = childrensmarriage; HttpContext.Current.Session["userplandetails"] = objusr; Plan pl = new Plan(); if (HttpContext.Current.Session["userplandetails"] != null) { pl = GetData(HttpContext.Current.Session["userplandetails"] as userdata); } pl.name = Convert.ToString(HttpContext.Current.Session["Name"]); pl.email = Convert.ToString(HttpContext.Current.Session["Email"]); pl.mobile = Convert.ToString(HttpContext.Current.Session["Mobile"]); HttpContext.Current.Session["CalculatedPlan"] = pl; } } catch (Exception ex) { res = "error:" + ex; } return(res); }
private static Plan GetData(userdata user) { //Write your logic here var pln = new Plan(); pln.status = user.stat; pln.currrentage = user.currage.ToString(); pln.retirementage = "N/A"; pln.lifeexpentency = "N/A"; var rsk = user.risk + user.knowledge + user.investing + user.stock; if (rsk <= 12.5) { pln.Risk_Ability = "15";//"Low"; } else if (rsk >= 12.6 && rsk <= 27.4) { pln.Risk_Ability = "25";// "Moderate"; } else { pln.Risk_Ability = "35";// "High"; } Dictionary <string, double> schemefindigdata = new Dictionary <string, double>(); pln.E_Fund_Amount = (user.monthlyexp * 6).ToString("#,##,##,###"); pln.E_Fund_SIP = (0).ToString("#,##,##,###"); //??? pln.Risk_T_Insurance = (user.anualincome * 10).ToString("#,##,##,###"); pln.Risk_FF_Insurance = get_health_insurance(user.stat, user.noofchild, user.anualincome).ToString("#,##,##,###"); //??? List <string> chrtdata = new List <string>(); List <string> chrtdata_title = new List <string>(); List <string> chrtdata_value = new List <string>(); string[] goals = user.goals.Split('~'); for (int i = 0; i < goals.Length; i++) { if (goals[i] == "CE") { pln.ChildE = true; } if (goals[i] == "CM") { pln.ChildM = true; } if (goals[i] == "AC") { pln.Asset = true; } if (goals[i] == "VC") { pln.Vacation = true; } if (goals[i] == "OC") { pln.other = true; } if (goals[i] == "RA") { pln.Retire = true; } } if (pln.ChildE) { string[] chlidage = user.childrensage.Split('~'); string[] chlidedu = user.childrenseducation.Split('~'); int tottime = 0; List <int> cage = new List <int>(); List <double> cedu = new List <double>(); for (int i = 0; i < chlidage.Length; i++) { cage.Add(Convert.ToInt32(chlidage[i])); tottime = tottime + (18 - Convert.ToInt32(chlidage[i])); } for (int i = 0; i < chlidedu.Length; i++) { cedu.Add(Convert.ToDouble(chlidedu[i])); } List <string> ce = Child_Goal_calculator(18, cedu, cage, user.inflation, user.investing, user.stock, user.knowledge, user.risk); pln.ChildE_SIP = ce[0]; pln.ChildE_Amount = ce[1]; string res = asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, tottime, pln.ChildE_SIP); string[] t = res.Split(','); if (chrtdata_title.Contains(t[0])) { int i = chrtdata_title.IndexOf(t[0]); int amt = Convert.ToInt32(chrtdata_value[i]); int amt2 = Convert.ToInt32(t[1]); chrtdata_value[i] = Convert.ToString(amt + amt2); } else { chrtdata_title.Add(t[0]); chrtdata_value.Add(t[1]); } int mintime = 18 - cage.Max(); string key = getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(mintime)); if (schemefindigdata.ContainsKey(key)) { schemefindigdata[key] = schemefindigdata[key] + Convert.ToDouble(pln.ChildE_SIP.Replace(",", "")); } else { schemefindigdata.Add(key, Convert.ToDouble(pln.ChildE_SIP.Replace(",", ""))); } //chrtdata.Add(asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, tottime, pln.ChildE_SIP)); } else { pln.ChildE_SIP = "0"; pln.ChildE_Amount = "0"; } if (pln.ChildM) { string[] chlidage = user.childrensage.Split('~'); string[] chlidm = user.childrensmarriage.Split('~'); int tottime = 0; List <int> cage = new List <int>(); List <double> cmr = new List <double>(); for (int i = 0; i < chlidage.Length; i++) { cage.Add(Convert.ToInt32(chlidage[i])); tottime = tottime + (24 - Convert.ToInt32(chlidage[i])); } for (int i = 0; i < chlidm.Length; i++) { cmr.Add(Convert.ToDouble(chlidm[i])); } List <string> cm = Child_Goal_calculator(24, cmr, cage, user.inflation, user.investing, user.stock, user.knowledge, user.risk); pln.ChildM_SIP = cm[0]; pln.ChildM_Amount = cm[1]; string res = asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, tottime, pln.ChildM_SIP); string[] t = res.Split(','); if (chrtdata_title.Contains(t[0])) { int i = chrtdata_title.IndexOf(t[0]); int amt = Convert.ToInt32(chrtdata_value[i]); int amt2 = Convert.ToInt32(t[1]); chrtdata_value[i] = Convert.ToString(amt + amt2); } else { chrtdata_title.Add(t[0]); chrtdata_value.Add(t[1]); } int mintime = 24 - cage.Max(); string key = getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(mintime)); if (schemefindigdata.ContainsKey(key)) { schemefindigdata[key] = schemefindigdata[key] + Convert.ToDouble(pln.ChildM_SIP.Replace(",", "")); } else { schemefindigdata.Add(key, Convert.ToDouble(pln.ChildM_SIP.Replace(",", ""))); } //schemefindigdata.Add(getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(mintime)), Convert.ToDouble(pln.ChildM_SIP.Replace(",", ""))); //chrtdata.Add(asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, tottime, pln.ChildM_SIP)); } else { pln.ChildM_SIP = "0"; pln.ChildM_Amount = "0"; } if (pln.Retire) { pln.retirementage = user.retireage.ToString(); pln.lifeexpentency = user.life.ToString(); List <string> rt = retirement_calculator(user.currage, user.retireage, user.life, user.monthlyexp, user.inflation, user.investing, user.stock, user.knowledge, user.risk); pln.Retire_SIP = rt[0]; pln.Retire_Amount = rt[1]; string res = asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.retireage - user.currage, pln.Retire_SIP); string[] t = res.Split(','); if (chrtdata_title.Contains(t[0])) { int i = chrtdata_title.IndexOf(t[0]); int amt = Convert.ToInt32(chrtdata_value[i]); int amt2 = Convert.ToInt32(t[1]); chrtdata_value[i] = Convert.ToString(amt + amt2); } else { chrtdata_title.Add(t[0]); chrtdata_value.Add(t[1]); } string key = getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(user.retireage - user.currage)); if (schemefindigdata.ContainsKey(key)) { schemefindigdata[key] = schemefindigdata[key] + Convert.ToDouble(pln.Retire_SIP.Replace(",", "")); } else { schemefindigdata.Add(key, Convert.ToDouble(pln.Retire_SIP.Replace(",", ""))); } //chrtdata.Add(asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.retireage - user.currage, pln.Retire_SIP)); } else { pln.Retire_SIP = "0"; pln.Retire_Amount = "0"; } if (pln.Vacation) { List <string> v = Goal_calculator(user.vacationcost, user.vacationtime, user.inflation, user.investing, user.stock, user.knowledge, user.risk); pln.Vacation_SIP = v[0]; pln.Vacation_Amount = v[1]; string res = asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.vacationtime, pln.Vacation_SIP); string[] t = res.Split(','); if (chrtdata_title.Contains(t[0])) { int i = chrtdata_title.IndexOf(t[0]); int amt = Convert.ToInt32(chrtdata_value[i]); int amt2 = Convert.ToInt32(t[1]); chrtdata_value[i] = Convert.ToString(amt + amt2); } else { chrtdata_title.Add(t[0]); chrtdata_value.Add(t[1]); } string key = getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(user.vacationtime)); if (schemefindigdata.ContainsKey(key)) { schemefindigdata[key] = schemefindigdata[key] + Convert.ToDouble(pln.Vacation_SIP.Replace(",", "")); } else { schemefindigdata.Add(key, Convert.ToDouble(pln.Vacation_SIP.Replace(",", ""))); } //schemefindigdata.Add(getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(user.vacationtime)), Convert.ToDouble(pln.Vacation_SIP.Replace(",", ""))); //chrtdata.Add(asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.vacationtime, pln.Vacation_SIP)); } else { pln.Vacation_SIP = "0"; pln.Vacation_Amount = "0"; } if (pln.Asset) { List <string> a = Goal_calculator(user.assetcost, user.assettime, user.inflation, user.investing, user.stock, user.knowledge, user.risk); pln.Asset_SIP = a[0]; pln.Asset_Amount = a[1]; string res = asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.assettime, pln.Asset_SIP); string[] t = res.Split(','); if (chrtdata_title.Contains(t[0])) { int i = chrtdata_title.IndexOf(t[0]); int amt = Convert.ToInt32(chrtdata_value[i]); int amt2 = Convert.ToInt32(t[1]); chrtdata_value[i] = Convert.ToString(amt + amt2); } else { chrtdata_title.Add(t[0]); chrtdata_value.Add(t[1]); } string key = getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(user.assettime)); if (schemefindigdata.ContainsKey(key)) { schemefindigdata[key] = schemefindigdata[key] + Convert.ToDouble(pln.Asset_SIP.Replace(",", "")); } else { schemefindigdata.Add(key, Convert.ToDouble(pln.Asset_SIP.Replace(",", ""))); } //schemefindigdata.Add(getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(user.assettime)), Convert.ToDouble(pln.Asset_SIP.Replace(",", ""))); //chrtdata.Add(asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.assettime, pln.Asset_SIP)); } else { pln.Asset_SIP = "0"; pln.Asset_Amount = "0"; } if (pln.other) { List <string> o = Goal_calculator(user.othercost, user.othertime, user.inflation, user.investing, user.stock, user.knowledge, user.risk); pln.other_SIP = o[0]; pln.other_Amount = o[1]; string res = asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.othertime, pln.other_SIP); string[] t = res.Split(','); if (chrtdata_title.Contains(t[0])) { int i = chrtdata_title.IndexOf(t[0]); int amt = Convert.ToInt32(chrtdata_value[i]); int amt2 = Convert.ToInt32(t[1]); chrtdata_value[i] = Convert.ToString(amt + amt2); } else { chrtdata_title.Add(t[0]); chrtdata_value.Add(t[1]); } string key = getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(user.othertime)); if (schemefindigdata.ContainsKey(key)) { schemefindigdata[key] = schemefindigdata[key] + Convert.ToDouble(pln.other_SIP.Replace(",", "")); } else { schemefindigdata.Add(key, Convert.ToDouble(pln.other_SIP.Replace(",", ""))); } //schemefindigdata.Add(getSchemeName(Convert.ToInt32(pln.Risk_Ability), Convert.ToInt32(user.othertime)), Convert.ToDouble(pln.other_SIP.Replace(",", ""))); //chrtdata.Add(asset_allocation_chart_data(user.investing, user.stock, user.knowledge, user.risk, user.othertime, pln.other_SIP)); } else { pln.other_SIP = "0"; pln.other_Amount = "0"; } for (int i = 0; i < chrtdata_title.Count; i++) { chrtdata.Add(chrtdata_title[i] + "," + chrtdata_value[i]); } pln.chartdata = String.Join("~", chrtdata.ToArray()); pln.illness = "No"; if (user.illness) { pln.illness = "Yes"; } Dictionary <string, double> finalschemefindigdata = new Dictionary <string, double>(); if (schemefindigdata.Keys.Count > 1) { foreach (var key in schemefindigdata.Keys) { finalschemefindigdata.Add(key, schemefindigdata[key]); } finalschemefindigdata.Add("E0", Convert.ToDouble(pln.E_Fund_Amount.Replace(",", ""))); } else { foreach (var key in schemefindigdata.Keys) { finalschemefindigdata.Add(key + "3", schemefindigdata[key]); } finalschemefindigdata.Add("E0", Convert.ToDouble(pln.E_Fund_Amount.Replace(",", ""))); } string schemes = ""; foreach (var key in finalschemefindigdata.Keys) { schemes = schemes + "" + LeadTracker.getSchemeCodeByname(key) + "~" + finalschemefindigdata[key] + "|"; } pln.Schemes = schemes; return(pln); }