Example #1
0
        public ActionResult Detail(int id, bool?showHistory, bool?smazane)
        {
            if (showHistory != null && showHistory == true)
            {
                ViewBag.ShowHistory = true;
            }
            else
            {
                ViewBag.ShowHistory = false;
            }

            if (smazane == true)
            {
                ViewBag.ZeSmazanych = true;
            }

            var lopDao = new LopDao();
            var lop    = lopDao.GetById(id);

            if (lop == null)
            {
                TempData[MessagesHelper.Danger] = "Nebyl nalezen lop";
                return(RedirectToAction("Index"));
            }
            ViewBag.timeline = new LopWorkFlowEventDao().GetByLop(lop);
            return(View(lop));
        }
Example #2
0
        // GET: Home
        public ActionResult Index()
        {
            if (!Uzivatel.UserExists(User.Identity.Name))
            {
                TempData[MessagesHelper.Info] = Resources.HomeTexts.NotAuthorized;
                return(RedirectToAction("About", "Home"));
            }

            var me = new Uzivatel(User.Identity.Name);  // 1. naštení 28ms

            var me2 = new Uzivatel(User.Identity.Name); // 2. 6ms - jak? jsem frajer..... Jarda

            /*var lops = new LopDao().GetAll(uziv);
             * var ukolved = new UkolVedeniDao().GetAll(uziv);
             * var ukoloddel = new UkolOddeleniDao().GetAll(uziv);
             * var ukolvzork = new UkolVzorkovaniDao().GetAll(uziv);
             *
             * return View(new HomeCollection(lops, ukoloddel, ukolved, ukolvzork));
             */
            var lopDao = new LopDao();

            ViewBag.lopMeAsZadavatel = lopDao.GetAll();
            ViewBag.lopMeAsResitel   = lopDao.GetAll();
            return(View());
        }
Example #3
0
        public ActionResult NhapFile(HttpPostedFileBase excelfile)
        {
            if (excelfile == null || excelfile.ContentLength == 0)
            {
                ViewBag.Error = "Bạn chưa tải file lên<br>";
                return(View());
            }
            else
            {
                if (excelfile.FileName.EndsWith("xls") || excelfile.FileName.EndsWith("xlsx"))
                {
                    string path = Server.MapPath("~/assets/excel/" + excelfile.FileName);
                    if (System.IO.File.Exists(path))
                    {
                        System.IO.File.Delete(path);
                    }
                    excelfile.SaveAs(path);
                    //read data form excel
                    Excel.Application application = new Excel.Application();
                    Excel.Workbook    workbook    = application.Workbooks.Open(path);
                    Excel.Worksheet   worksheet   = workbook.ActiveSheet;
                    Excel.Range       range       = worksheet.UsedRange;
                    var listSV = new SinhVienDao();
                    for (int row = 2; row < range.Rows.Count; row++)
                    {
                        var sv = new SinhVien();
                        sv.MaSV      = double.Parse(((Excel.Range)range.Cells[row, 1]).Text);
                        sv.HoTen     = ((Excel.Range)range.Cells[row, 2]).Text;
                        sv.GioiTinh  = ((Excel.Range)range.Cells[row, 3]).Text;
                        sv.SoDT      = ((Excel.Range)range.Cells[row, 4]).Text;
                        sv.Email     = ((Excel.Range)range.Cells[row, 5]).Text;
                        sv.NgaySinh  = DateTime.Now;
                        sv.NoiSinh   = ((Excel.Range)range.Cells[row, 7]).Text;
                        sv.ChoTamTru = ((Excel.Range)range.Cells[row, 8]).Text;
                        sv.ChucVu    = ((Excel.Range)range.Cells[row, 9]).Text;

                        var Lop = new LopDao();

                        sv.Id_Lop = Lop.lop(((Excel.Range)range.Cells[row, 10]).Text).Id_Lop;

                        var nganh = new NganhDao();

                        sv.Id_Nganh = nganh.nganh(((Excel.Range)range.Cells[row, 11]).Text).Id_Nganh;
                        listSV.create1(sv);
                    }

                    return(View());
                }

                else
                {
                    ViewBag.Error = "Bạn chưa tải file lên";
                    return(View());
                }
            }


            return(View());
        }
Example #4
0
        public ActionResult Index(string searchString, int page = 1, int pageSize = 10)
        {
            var dao   = new LopDao();
            var model = dao.ListLop(searchString, page, pageSize);

            ViewBag.SearchString = searchString;
            return(View(model));
        }
Example #5
0
        public ActionResult ThemLop(Lop lop)
        {
            var lopdao = new LopDao();

            lopdao.themlop(lop);

            return(View());
        }
Example #6
0
        public ActionResult Edit(int id)
        {
            var lop     = new LopDao();
            var content = lop.ViewDetail(id);

            SetViewBag(content.DonViID);
            return(View(content));
        }
Example #7
0
        public ActionResult ThemSV(User us)
        {
            var lop   = new LopDao();
            var nganh = new NganhDao();

            SetViewBag(lop.Id_lop_MacDinh());
            SetViewBag2(nganh.Id_Nganh_MacDinh());
            return(View());
        }
        public ActionResult Index(string searchYeuCau, string searchTinhTrang, string searchName,
                                  string searchTenDanhMuc, string searchTenDonVi, string searchTenLop, string searchEmail, string searchTenVaiTro, int page = 1, int pageSize = 10)
        {
            var dao   = new HocVuDao();
            var model = dao.ListThongKe(searchYeuCau, searchTinhTrang, searchName, searchTenDanhMuc,
                                        searchTenDonVi, searchTenLop, searchEmail, searchTenVaiTro, page, pageSize);
            var dao1 = new DonViDao();

            ViewBag.listDonVi     = new SelectList(dao1.ListAll(), "TenDonVi", "TenDonVi");
            ViewBag.listTinhTrang = new SelectList(dao.ListAll(), "TinhTrang", "TinhTrang");
            var lop = new LopDao();

            ViewBag.listLop = new SelectList(lop.ListAll(), "TenLop", "TenLop");
            var vaitro = new VaiTroDao();

            ViewBag.listVaiTro       = new SelectList(vaitro.ListAll(), "TenVaiTro", "TenVaiTro");
            ViewBag.searchYeuCau     = searchYeuCau;
            ViewBag.searchTinhTrang  = searchTinhTrang;
            ViewBag.searchName       = searchName;
            ViewBag.searchTenDanhMuc = searchTenDanhMuc;
            ViewBag.searchTenDonVi   = searchTenDonVi;
            ViewBag.searchTenLop     = searchTenLop;
            ViewBag.searchEmail      = searchEmail;
            ViewBag.searchTenVaiTro  = searchTenVaiTro;

            var        list     = dao.ListAll();
            List <int> repart   = new List <int>();
            var        userID   = list.Select(x => x.UserID).Distinct();
            var        listUser = from a in userID
                                  join b in db.Users on a.Value equals b.UserID
                                  select b.UserName;

            foreach (var item in userID)
            {
                repart.Add(list.Count(x => x.UserID == item));
            }
            var rep = repart;

            ViewBag.UserID = listUser;
            ViewBag.REP    = repart.ToList();


            var danhmucID = list.Select(x => x.DanhMucID).Distinct();
            var listDM    = from a in danhmucID
                            join b in db.DanhMucs on a.ToString() equals b.DanhMucID.ToString()
                            select b.TenDanhMuc;

            List <int> listDanhMuc = new List <int>();

            foreach (var item in danhmucID)
            {
                listDanhMuc.Add(list.Count(x => x.DanhMucID == item));
            }
            ViewBag.danhmucID   = listDM;
            ViewBag.listDanhMuc = listDanhMuc.ToList();
            return(View(model));
        }
Example #9
0
        public ActionResult Create(Lop collection, bool poslatMail, string produktyInput)
        {
            ViewBag.FirstCreate = false;
            try
            {
                if (ModelState.IsValid)
                {
                    LopDao lopDao = new LopDao();

                    collection.StartDate       = DateTime.Now;
                    collection.LastChangedDate = DateTime.Now;
                    collection.Status          = StatusUkolu.Open; //když vytváříme - úkol je standartně otevřený
                    var latest = lopDao.GetLatestLopThisYear();
                    collection.Action = latest?.Action + 1 ?? 1;
                    collection.Id     = (int)lopDao.Create(collection);
                    TempData[MessagesHelper.Success] = Resources.LopTexts.UkolPridany;

                    if (produktyInput != "")
                    {
                        try
                        {
                            var ukolMaterialDao = new LopMaterialDao();
                            foreach (var ukolProdukt in produktyInput.Split(';').Where(item => item != "").Select(item => new LopMaterial()
                            {
                                Lop = collection,
                                Produkt = new MaterialDao().GetById(Convert.ToInt32(item)),
                                DateAdded = DateTime.Now
                            }))
                            {
                                ukolMaterialDao.Create(ukolProdukt);
                            }
                        }
                        catch
                        {
                            TempData[MessagesHelper.Danger] = Resources.LopTexts.NepodariloSePripojeniProduktuKUkolu;
                        }
                    }
                    new LopMaterialDao().ClearWrongHistoryAfterCreate(); //po vytvoření je nadbytečná historie lopu

                    //posíláme vždy
                    //if (!poslatMail) return RedirectToAction("Detail", new {id = collection.Id});
                    var s = Resources.LopTexts.BylVamPridelenNovyUkol +
                            " <a href='/Lop/Detail/" + collection.Id + "'>" + collection.Nazev + "</a>";
                    Notifikace.Create(collection.Resitel.Id, s);

                    return(RedirectToAction("Detail", new { id = collection.Id }));
                }
                TempData[MessagesHelper.Warning] = Resources.LopTexts.ZkontrolujteZadaneUdaje;
            }
            catch
            {
                TempData[MessagesHelper.Danger] = Resources.LopTexts.DosloKNeocekavaneChybe;
            }
            return(View(collection));
        }
Example #10
0
        public ActionResult DenyLop(int id, string deniedMessage)
        {
            try
            {
                if (String.IsNullOrEmpty(deniedMessage.Trim()))
                {
                    deniedMessage = "Odmítnuto (bez udání důvodu)"; //natvrdo popisek
                }

                LopDao lopDao = new LopDao();
                Lop    lop    = lopDao.GetById(id);

                /*
                 * //uložení historie
                 * var histDao = new LopHistoryDao();
                 * var copy = new LopHistory(lop);
                 * histDao.Create(copy);
                 */

                lop.LastChangedDate = DateTime.Now; //něco se děje
                lop.DeniedMessage   = deniedMessage;

                //update objektu
                lopDao.Update(lop);

                LopWorkFlowEvent.Create(lop,
                                        LopWorkFlowEvent.Colors.Danger,
                                        LopWorkFlowEvent.Icons.User,
                                        "Odmítnutí odpovědnosti",
                                        "Řešitel odmítl řešit tento úkol. <q>" + deniedMessage + "</q>",
                                        User.Identity.Name
                                        );

                var s = lop.Resitel + " " + Resources.LopTexts.OdmitlResitUkol + " " +
                        "<a href='/Lop/Detail/" + lop.Id + "'>" + lop.Nazev +
                        "</a><br />" + lop.DeniedMessage;
                Notifikace.Create(lop.Zadavatel.Id, s);

                TempData[MessagesHelper.Success] = Resources.LopTexts.UkolBylOdmitnut;

                return(RedirectToAction("Index"));
            }
            catch
            {
                TempData[MessagesHelper.Warning] = Resources.LopTexts.NepodariloSeOdmitnoutUkol;
            }

            return(RedirectToAction("Detail/" + id));
        }
Example #11
0
        public ActionResult Edit(int id)
        {
            var dao  = new LopDao();
            var item = dao.GetById(id);

            if (item == null)
            {
                return(RedirectToAction("Index"));
            }

            var matDao       = new MaterialDao();
            var materialList = matDao.GetAll();

            ViewBag.materialList = materialList;

            TempData["LopHistory"] = item;
            return(View(item));
        }
Example #12
0
        public ActionResult Delete(int id)
        {
            var lopDao = new LopDao();
            var lop    = lopDao.GetById(id);

            try
            {
                lop.Deleted = true;
                lopDao.Update(lop);
            }
            catch (Exception)
            {
                TempData[MessagesHelper.Danger] = Resources.LopTexts.DosloKNeocekavaneChybe;
                return(RedirectToAction("Detail", new { id = lop.Id }));
            }
            TempData[MessagesHelper.Success] = Resources.LopTexts.UkolSmazan;
            return(RedirectToAction("Index"));
        }
Example #13
0
        public ActionResult Create(Lop lop)
        {
            if (ModelState.IsValid)
            {
                var dao = new LopDao();
                int id  = dao.Insert(lop);
                if (id > 0)
                {
                    SetAlert("Thêm lớp thành công", "success");
                    return(RedirectToAction("Index", "Lop"));
                }
                else
                {
                    ModelState.AddModelError("", "Thêm lóp không thành công");
                }
                SetViewBag();
            }

            return(View("Index"));
        }
Example #14
0
        public ActionResult Edit(Lop lop)
        {
            if (ModelState.IsValid)
            {
                var dao = new LopDao();

                var result = dao.Update(lop);

                if (result)
                {
                    SetAlert("Chỉnh sửa lớp thành công", "success");
                    return(RedirectToAction("Index", "Lop"));
                }
                else
                {
                    ModelState.AddModelError("", "cập nhật không thành công");
                }
                SetViewBag(lop.DonViID);
            }
            return(View("Index"));
        }
Example #15
0
        // GET: Lop
        public ActionResult Index(bool?smazane)
        {
            if (!Uzivatel.UserExists(User.Identity.Name))
            {
                TempData[MessagesHelper.Info] = Resources.HomeTexts.NotAuthorized;
                return(RedirectToAction("About", "Home"));
            }
            ViewBag.showAll = false;
            var         lopDao = new LopDao();
            IList <Lop> listLop;

            if (smazane == true)
            {
                ViewBag.ZeSmazanych = true;
                listLop             = lopDao.GetOnlyDeleted(new UzivatelDao().GetByWindowsId(User.Identity.Name));
            }
            else
            {
                listLop = lopDao.GetAll(new UzivatelDao().GetByWindowsId(User.Identity.Name));
            }
            return(View(listLop));
        }
Example #16
0
        public ActionResult Test()
        {
            var lopDao = new LopDao();
            var rnd    = new Random();

            for (int i = lopDao.GetLatestLopThisYear().Action; i < 10000; i++)
            {
                lopDao.Create(new Lop()
                {
                    Action           = i,
                    Nazev            = "Lop " + i,
                    Zadavatel        = new UzivatelDao().GetById(rnd.Next(1, 8)),
                    Resitel          = new UzivatelDao().GetById(rnd.Next(1, 8)),
                    Status           = StatusUkolu.Open,
                    StartDate        = DateTime.Now,
                    LastChangedDate  = DateTime.Now,
                    PlannedCloseDate = DateTime.Now.AddDays(40),
                    Popis            = "blsadklasmdaskldmalsdm"
                });
            }
            TempData[MessagesHelper.Success] = "Záznamy lopu vygenerovány";

            return(RedirectToAction("Index"));
        }
Example #17
0
        public void SetViewBag(int?selectedId = null)
        {
            var dao = new LopDao();

            ViewBag.Id_Lop = new SelectList(dao.ListCurent(), "Id_Lop", "TenLop", selectedId);
        }
        public void SetViewBagLop(int?LopID = null)
        {
            var dao = new LopDao();

            ViewBag.LopID = new SelectList(dao.ListAll(), "LopID", "TenLop", LopID);
        }
Example #19
0
        public ActionResult Edit(int id, Lop collection, bool poslatMailResiteli, bool poslatMailZadavateli, string produktyInput)
        {
            var history = TempData["LopHistory"] as Lop;

            if (history == null)
            {
                return(RedirectToAction("Index"));
            }
            try
            {
                collection.Zadavatel = new UzivatelDao().GetByWindowsId(User.Identity.Name);
                if (ModelState.IsValid)
                {
                    if (produktyInput != history.MaterialyInput)
                    {
                        var lopMaterialDao = new LopMaterialDao();
                        foreach (var item in history.MaterialyInput.Split(';').Where(item => !produktyInput.Contains(";" + item + ";")).Where(item => item != ""))
                        { // Odebrání přebytečných
                            lopMaterialDao.Delete(history.Materialy.First(x => x.Produkt.Id == Convert.ToInt32(item)));
                        }
                        try
                        {//Přidání nových
                            foreach (var lopProdukt in produktyInput.Split(';').Where(item => item != "").Select(item => new LopMaterial()
                            {
                                Lop = new Lop()
                                {
                                    Id = collection.Id
                                },
                                Produkt = new MaterialDao().GetById(Convert.ToInt32(item)),
                                DateAdded = DateTime.Now
                            }).Where(lopProdukt => !history.MaterialyInput.Contains(lopProdukt.Produkt.Id.ToString())))
                            {
                                lopMaterialDao.Create(lopProdukt);
                            }
                        }
                        catch
                        {
                            TempData[MessagesHelper.Danger] = Resources.LopTexts.NepodariloSePripojeniProduktuKUkolu;
                        }
                    }

                    //TEST SHODNOTI

                    /*
                     * if (collection.IsSame(history)) //vrací FALSE, pokud nastala změna
                     * {
                     *  if (produktyInput != history.MaterialyInput)
                     *  {
                     *      TempData[MessagesHelper.Success] = Resources.LopTexts.ProvazaneMaterialyBylyAktualizovany;
                     *      return RedirectToAction("Detail/" + collection.Id);
                     *  }
                     *  TempData[MessagesHelper.Info] = Resources.LopTexts.NebylyProvedenyZadneZmeny;
                     *  return RedirectToAction("Detail/" + collection.Id);
                     * }
                     */

                    //KONTROLA JESTLI LZE ÚKOL UZAVŘÍT
                    if (collection.Status == StatusUkolu.Closed)
                    {
                        int celkemUkolu   = history.PocetSubUkoluCelkem();
                        int ukoluHotovych = history.PocetSubUkoluCompleted();

                        if (celkemUkolu != ukoluHotovych)
                        {
                            TempData[MessagesHelper.Info] = Resources.LopTexts.NelzeUkoncitUkol1 + " (" +
                                                            (celkemUkolu - ukoluHotovych) + ") " + Resources.LopTexts.NelzeUkoncitUkol2;
                        }
                    }
                    else
                    {
                        //ZMĚNA? - ULOŽÍME DO HISTORIE A PŘEPÍŠEME
                        var lopDao     = new LopDao();
                        var lopHistDao = new LopHistoryDao();

                        /*
                         * //uložení historie
                         * var copy = new LopHistory(history);
                         * lopHistDao.Create(copy);
                         */
                        //update objektu
                        collection.LastChangedDate = DateTime.Now;
                        lopDao.Update(collection);
                        TempData[MessagesHelper.Success] = Resources.LopTexts.LopUspesneAktualizovan;

                        if (poslatMailResiteli)
                        {
                            var s = Resources.LopTexts.BylUpravenLop +
                                    " <a href='/Lop/Detail/" + collection.Id + "?showHistory=true#historyBtn'>" + collection.Nazev + "</a>";
                            Notifikace.Create(collection.Resitel.Id, s);
                        }
                        if (poslatMailZadavateli)
                        {
                            var s = Resources.LopTexts.BylUpravenLop +
                                    " <a href='/Lop/Detail/" + collection.Id + "?showHistory=true#historyBtn'>" + collection.Nazev + "</a>";
                            Notifikace.Create(collection.Zadavatel.Id, s);
                        }
                        return(Redirect(Url.RouteUrl(new { controller = "Lop", action = "Detail", id = collection.Id, showHistory = true })));
                    }
                    //return RedirectToAction("Detail", new {id = collection.Id, showHistory = true});
                }
                TempData[MessagesHelper.Warning] = Resources.LopTexts.ZkontrolujteZadaneUdaje;
            }
            catch (Exception)
            {
                TempData[MessagesHelper.Danger] = Resources.LopTexts.DosloKNeocekavaneChybe;
            }
            TempData["LopHistory"] = history;
            var matDao       = new MaterialDao();
            var materialList = matDao.GetAll();

            ViewBag.materialList = materialList;
            collection.SubUkoly  = history.SubUkoly;
            collection.Materialy = history.Materialy;
            return(View(collection));
        }
Example #20
0
        public ActionResult FinishUkol(int id, bool finished, string komentar)
        {
            try
            {
                LopDao lopD = new LopDao();
                Lop    lop  = lopD.GetById(id);

                lop.LastChangedDate = DateTime.Now; //něco se děje

                if (finished)
                {
                    //KONTROLA JESTLI LZE UKONČIT ÚKOL, DOKUD NEJSOU UKONČENY PODÚKOLY
                    //teoreticky můžeme přesměrovat na hlášku, jestli chce zadavatel označit všechny podúkoly
                    //jako vyřešené?
                    //btw .. tlačítko na tuhle akci ukážu jen pokud jsou všechny done ;)
                    int celkemUkolu   = lop.PocetSubUkoluCelkem();
                    int ukoluHotovych = lop.PocetSubUkoluCompleted();

                    if (celkemUkolu != ukoluHotovych)
                    {
                        TempData[MessagesHelper.Info] = Resources.LopTexts.NelzeUkoncitUkol1 + " (" + (celkemUkolu - ukoluHotovych) + ") " + Resources.LopTexts.NelzeUkoncitUkol2;
                        return(RedirectToAction("Index"));
                    }
                    Uzivatel u           = new UzivatelDao().GetByWindowsId(User.Identity.Name.ToUpper());
                    bool     isZadavatel = u.Id == lop.Zadavatel.Id;
                    bool     isZadavatelATeprveUzavira = false;
                    if (isZadavatel && lop.Status == StatusUkolu.Open) //v případě že je uživatel zároveň Zadavatel a Řešitel
                    {
                        isZadavatelATeprveUzavira = true;
                    }

                    if (isZadavatel && lop.Status == StatusUkolu.Closed)
                    {
                        lop.CheckDate  = DateTime.Now; //proběhla kontrola (ať už jakákoliv)
                        lop.FinishDate = DateTime.Now; //v pořádku

                        #region workflow-event
                        LopWorkFlowEvent.Create(lop,
                                                LopWorkFlowEvent.Colors.Success,
                                                LopWorkFlowEvent.Icons.Ok,
                                                "Úkol uzavřen",
                                                "Zadavatel přijal řešení úkolu a úkol uzavřel jako splněný. <q>" + komentar + "</q>",
                                                User.Identity.Name
                                                );
                        #endregion
                    }
                    else
                    {
                        #region workflow-event
                        LopWorkFlowEvent.Create(lop,
                                                LopWorkFlowEvent.Colors.Info,
                                                LopWorkFlowEvent.Icons.User,
                                                "Úkol dokončen",
                                                "Řešitel označil úkol jako splněný - čeká na schválení zadavatelem. <q>" + komentar + "</q>",
                                                User.Identity.Name
                                                );
                        #endregion
                        lop.CloseDate = DateTime.Now;
                    }

                    lop.Status = StatusUkolu.Closed; //řešitel pouze uzavírá na close
                    if (!string.IsNullOrEmpty(komentar))
                    {
                        var koment = komentar + "<br />";
                        koment      += $"<span class=\"glyphicon glyphicon-time\"></span><i>{DateTime.Now} - by {new Uzivatel(User.Identity.Name)}</i>";
                        lop.Komentar = (!string.IsNullOrEmpty(lop.Komentar) ? lop.Komentar + "<hr />" + koment : koment);
                    }
                    //update objektu
                    lopD.Update(lop);
                    if (isZadavatel && !isZadavatelATeprveUzavira) //tuto hlášku nechceme generovat, pokud je to sice zadavatel ale zároveň řešitel a teprve uzavírá úkol poprvé ;)
                    {
                        string s = Resources.LopTexts.ByloPrijatoReseniLopu +
                                   " <a href='/Lop/Detail/" + lop.Id + "?showHistory=true#historyBtn'>" + lop.Nazev +
                                   "</a>";
                        Notifikace.Create(lop.Resitel.Id, s);
                    }
                    else
                    {
                        string s = Resources.LopTexts.UkolBylOznacenJakoVyreseny +
                                   " <a href='/Lop/Detail/" + lop.Id + "'>" + lop.Nazev + "</a>";
                        Notifikace.Create(lop.Zadavatel.Id, s);
                    }
                    TempData[MessagesHelper.Success] = Resources.LopTexts.UkolBylVyresen;
                }
                else
                {
                    //pokud chceme označit jako nevyřešený
                    lop.CheckDate  = DateTime.Now;     //proběhla kontrola (ať už jakákoliv)
                    lop.CloseDate  = null;
                    lop.FinishDate = null;             //nepřijato
                    lop.Status     = StatusUkolu.Open; //úkol musí být dále zpracováván
                    if (!string.IsNullOrEmpty(komentar))
                    {
                        var koment = komentar + "<br />";
                        koment      += $"<span class=\"glyphicon glyphicon-time\"></span><i>{DateTime.Now} - by {new Uzivatel(User.Identity.Name)}</i>";
                        lop.Komentar = (!string.IsNullOrEmpty(lop.Komentar) ? lop.Komentar + "<hr />" + koment : koment);
                    }
                    lopD.Update(lop);
                    #region workflow-event
                    LopWorkFlowEvent.Create(lop,
                                            LopWorkFlowEvent.Colors.Danger,
                                            LopWorkFlowEvent.Icons.Remove,
                                            "Řešení zamítnuto",
                                            "Zadavatel odmítl odevzdané řešení úkolu. <q>" + komentar + "</q>",
                                            User.Identity.Name
                                            );
                    #endregion
                    string s = Resources.LopTexts.ByloOdmitnutoReseniUkolu +
                               " <a href='/Lop/Detail/" + lop.Id + "?showHistory=true#historyBtn'>" + lop.Nazev + "</a>";
                    Notifikace.Create(lop.Resitel.Id, s);
                    TempData[MessagesHelper.Warning] = Resources.LopTexts.UkolJeZnovuVReseni;
                }
            }
            catch (Exception e)
            {
                TempData[MessagesHelper.Warning] = Resources.LopTexts.NepodariloSeUpravitZaznam;
            }

            return(RedirectToAction("Detail/" + id));
        }