Пример #1
0
        public ActionResult FormDetails(int ID)
        {
            db = new Models.IsBasvurusuEntities4();



            Models.FormTab form = db.FormTabs.Where(x => x.userId == ID).FirstOrDefault();

            return(View(form));
        }
Пример #2
0
        public ActionResult Login(IsBasvurusu.Models.LoginTable avm)
        {
            using (Models.IsBasvurusuEntities4 db = new Models.IsBasvurusuEntities4())
            {
                var userDetails = db.LoginTables.Where(x => x.userName == avm.userName
                                                       &&
                                                       x.password == avm.password).FirstOrDefault();

                if (userDetails == null)
                {
                    return(View("Login", avm));
                }
                else
                {
                    Session["userId"]   = userDetails.kID;
                    Session["UserName"] = userDetails.userName;
                    return(RedirectToAction("Panel", "Panel"));
                }
            }
        }
Пример #3
0
        public ActionResult Panel()
        {
            try
            {
                int sID = Convert.ToInt32(Session["userId"].ToString());

                string sName = Session["UserName"].ToString();


                db = new Models.IsBasvurusuEntities4();

                List <Models.FormTab> formList = new List <Models.FormTab>();


                formList = db.FormTabs.OrderByDescending(x => x.userId).ToList();

                return(View(formList));
            }
            catch (Exception ex)
            {
                ViewData.ModelState.AddModelError("_HATA", ex.Message);
                return(RedirectToAction("Login"));
            }
        }