Exemplo n.º 1
0
        public ActionResult Edit(int id)
        {
            Context.Tiket dbitem = RepoTiket.FindByPK(id);

            Tiket model = new Tiket(dbitem);

            ViewBag.name    = model.NoTiket;
            ViewBag.Creator = dbitem.CS.Fristname + " " + dbitem.CS.Lastname;
            if (dbitem.DitujukanKe.Split(',').Contains(UserPrincipal.id.ToString()) || UserPrincipal.id == dbitem.CreatedBy)
            {
                ViewBag.Responses   = dbitem.TiketResponse;
                ViewBag.setReadonly = dbitem.DitujukanKe.Split(',').Contains(UserPrincipal.id.ToString()) ? "true" : "false";
                ViewBag.SO          = dbitem.SalesOrder.SalesOrderOncall;
                ViewBag.TanggalTiba = RepoSalesOrder.TanggalTiba(dbitem.SalesOrder.SalesOrderOncall);
                ViewBag.CreatedBy   = dbitem.CreatedBy;
                return(View("FormComment", model));
            }
            else
            {
                return(View("Form", model));
            }
        }