Beispiel #1
0
        public ActionResult Edit()
        {
            if (ModelState.IsValid)
            {
                try
                {
                    TB_Schedule tb_Schedule = new TB_Schedule
                    {
                        BId = Convert.ToInt32(Request.Params["BId"]),
                        FId = Convert.ToInt32(Request.Params["FId"]),

                        FinishDate = Convert.ToDateTime(Request.Params["FollowDate"])
                                     //FinishDate = DateTime.Today
                    };
                    db.TB_Schedule.Add(tb_Schedule);
                    db.SaveChanges();
                    var lg = ((TB_LoginOn)Session["LoginName"]).AId;
                    if (lg == 2)
                    {
                        TB_BugSubmit YN = db.TB_BugSubmit.Where(t => t.BId == tb_Schedule.BId).FirstOrDefault();
                        YN.YN = "Y";
                        db.SaveChanges();
                    }
                    return(RedirectToAction("Index"));
                }
                catch (Exception ex)
                {
                    return(RedirectToAction("Edit"));
                }
            }
            return(View());
        }
Beispiel #2
0
        public ActionResult Update(int id)
        {
            TB_Schedule tb = db.TB_Schedule.Find(id);

            if (tb != null)
            {
                int          bid = tb.BId;
                TB_BugSubmit YN  = db.TB_BugSubmit.Where(t => t.BId == bid).FirstOrDefault();
                YN.YN = "Y";
                db.SaveChanges();
            }
            return(RedirectToAction("Index"));
        }
Beispiel #3
0
        public ActionResult Create([Bind(Include = "FinishDate,BId,FId")] TB_Schedule tB_Schedule)
        {
            if (ModelState.IsValid)
            {
                db.TB_Schedule.Add(tB_Schedule);
                var lg = ((TB_LoginOn)Session["LoginName"]).AId;
                if (lg == 2)
                {
                    TB_BugSubmit YN = db.TB_BugSubmit.Where(t => t.BId == tB_Schedule.BId).FirstOrDefault();
                    YN.YN = "Y";
                }
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.BId = new SelectList(db.TB_BugSubmit, "BId", "AppName", tB_Schedule.BId);
            return(View(tB_Schedule));
        }
Beispiel #4
0
        public ActionResult Details()
        {
            var Dt = Request.Params["FollowDate"];

            if (Dt == null)
            {
                Dt = DateTime.Now.ToShortDateString();
            }
            TB_Schedule tb_Follow = new TB_Schedule
            {
                BId        = Convert.ToInt32(Request.Params["BId"]),
                FId        = Convert.ToInt32(Request.Params["FId"]),
                FinishDate = Convert.ToDateTime(Dt)
            };

            db.TB_Schedule.Add(tb_Follow);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #5
0
        public ActionResult Update(int?id)
        {
            if (id == null)
            {
                //return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
                return(RedirectToAction("Index", "Home"));
            }
            TB_Schedule tB_Schedule = db.TB_Schedule.Find(id);

            if (tB_Schedule == null)
            {
                return(HttpNotFound());
            }
            if (Session["LoginName"] != null)
            {
                return(View(tB_Schedule));
            }
            return(RedirectToAction("Index", "Home"));
        }