public ActionResult mailinfo(string un, string ps) { harshalEntities jd = new harshalEntities(); csmodel mode = new csmodel(); List <csmodel> l = new List <csmodel>(); int ui = jd.UserInfoes.Where(i => i.Username == un && i.Password == ps).Select(i => i.UserID).FirstOrDefault(); if (ui != 0) { var m = jd.MailDetails.Where(i => i.UserID == ui).Select(i => i); foreach (var i in m) { l.Add(new csmodel() { mailid = i.MailID, sub = i.Subject }); } /*mode.MailID = i.mailid; * mode.Name = i.mailform; * mode.Date = (DateTime)(i.recieveddate); * mode.Message = i.mes;*/ } return(View(l)); }
public ActionResult Index(string un, string pass) { harshalEntities ctx = new harshalEntities(); LoginInfo ln = new LoginInfo(); UserDetail ud = new UserDetail(); var rec = ctx.LoginInfoes.Where(d => d.UserName == un && d.Passwrd == pass).FirstOrDefault(); if (rec != null) { var res = from e in ctx.LoginInfoes where e.UserName == "un" select new { id = e.UserId }; foreach (var d in res) { var obj = from a in ctx.UserDetails where a.UserId == d.id select a; foreach (var z in obj) { Console.WriteLine(z.DetId + " " + z.UserId + " " + z.Age + " " + z.City); } } return(Redirect("/User/Details?Id=" + rec.UserId)); } ViewBag.Msg = "Error in signin...."; return(View()); }
public ActionResult info(int id) { harshalEntities jd = new harshalEntities(); csmodel mode = new csmodel(); var m = jd.MailDetails.Where(i => i.MailID == id).Select(i => i).FirstOrDefault(); mode.mes = m.Message; return(View(mode)); }
public ActionResult Details() { int id = int.Parse(Request["Id"]); harshalEntities ctx = new harshalEntities(); var obj = ctx.UserDetails.Where(u => u.UserId == id).FirstOrDefault(); if (obj != null) { ViewBag.age = obj.Age; ViewBag.city = obj.City; ViewBag.rep = obj.ReportingTo; } return(View()); }