Пример #1
0
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
             REPORTEREntities1 db = new REPORTEREntities1();
             jobs jb = db.jobs.Where(e => e.Jid == id).Select(e => e).Single();
             db.jobs.DeleteObject(jb);
             db.SaveChanges();
             return RedirectToAction("Index");
     } catch
     {
             return View();
     }
 }
Пример #2
0
 public ActionResult Create(jobs jb)
 {
     try
     {
         REPORTEREntities1 db = new REPORTEREntities1();
         db.AddTojobs(jb);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Пример #3
0
        public ActionResult Details(int id)
        {
            REPORTEREntities1 db = new REPORTEREntities1 ();
            //var data = db.jobs.Where(e => e.Jid == id).Select(e => e).Single();
            var data = db.jobs.Where(e => e.Jid == id).Select(e => e);
            if (data.Count() == 0)
            {
                throw new NoSuchRecordException();
            }
            else
            {
                jobs jbrecord = data.Single();
                return View(jbrecord);
            }

            //return View(data);
        }
Пример #4
0
        //
        // GET: /Summ/
        public ActionResult Index()
        {
            REPORTEREntities1 db = new REPORTEREntities1();
            //blablabla.where(ttt = > ttt.Project== "Project1")
            //выбрать все элементы, свойство Project которых равно "Poject1"
            //var movies = from m in db.Table1

            //var query = from o in db.jobs
            //IEnumerable<Reporter1.Models.REPORTEREntities1> query = from j in db.jobs
            //                                           where j.Uid == 1
            //                                           select j;
                        //where (o.Uid == 1)
                        //group o.Date by o.Date into o
                        //select o;
                        //od => od.UnitPrice*od.Quantity) >= 10000);
            //var query = db(object=>db.SumTimeview2)
            return View();
        }
Пример #5
0
        public ActionResult Register(RegisterModel model)
        {
            if (ModelState.IsValid)
            {
                // Попытка зарегистрировать пользователя
                MembershipCreateStatus createStatus = MembershipService.CreateUser(model.UserName, model.Password,
                                                                                   model.Email);
                if (createStatus == MembershipCreateStatus.Success)
                {
                    REPORTEREntities1 db = new REPORTEREntities1();
                    UsersRP jb = new UsersRP();

                    jb.Login = model.UserName;
                    jb.Pass = model.Password;
                    jb.email = model.Email;
                    db.AddToUsersRP(jb);
                    db.SaveChanges();

                    FormsService.SignIn(model.UserName, false /* createPersistentCookie */);
                    return RedirectToAction("Index", "Home");
                }
                else
                {
                    ModelState.AddModelError("", AccountValidation.ErrorCodeToString(createStatus));
                }
                // Появление этого сообщения означает наличие ошибки; повторное отображение формы
                ViewData["PasswordLength"] = MembershipService.MinPasswordLength;
                return View(model);
            }
            return View();
        }
Пример #6
0
 public ActionResult Delete(int id)
 {
     REPORTEREntities1 db = new REPORTEREntities1();
     var data = db.jobs.Where(e => e.Jid == id).Select(e => e).Single();
     return View(data);
 }
Пример #7
0
        //
        // GET: /jobs/
        public ActionResult Index()
        {
            REPORTEREntities1 db = new REPORTEREntities1();
            System.Web.UI.Page wp = new System.Web.UI.Page();
            //string firstName = "wpride88";
            //if (Session != null) Session.Add("LgUser", firstName);
            // Redirect to second page.

            //string sss = Page.User.Identity.Name;

            System.Web.UI.Page pg = new System.Web.UI.Page();
            string sss = pg.User.Identity.Name;
            Session["LgUser"] = sss;
            return View();
        }