Esempio n. 1
0
        public DetailPaper getDetail(string id)
        {
            DetailPaper item = new DetailPaper();
            string      sql  = @"select p.*, rp.type, rp.reward_type, rp.total_reward, rp.specialization_id, rp.request_id
                            from [SM_ScientificProduct].Paper p join [SM_ScientificProduct].RequestPaper rp on p.paper_id = rp.paper_id
                            where p.paper_id = @id";

            item = db.Database.SqlQuery <DetailPaper>(sql, new SqlParameter("id", id)).FirstOrDefault();
            return(item);
        }
        public ActionResult Edit(string id, string editable)
        {
            ViewBag.title = "Chỉnh sửa khen thưởng bài báo";
            var pagesTree = new List <PageTree>
            {
                new PageTree("Chỉnh sửa khen thưởng bài báo", "/Paper/Edit"),
            };

            ViewBag.pagesTree = pagesTree;
            ViewBag.ckEdit    = editable;

            DetailPaper item = pr.getDetail(id);

            ViewBag.Paper = item;

            int request_id = item.request_id;

            string lang = "";

            if (Request.Cookies["language_name"] != null)
            {
                lang = Request.Cookies["language_name"].Value;
            }
            List <SpecializationLanguage> listSpec = md.getSpec(lang);

            ViewBag.listSpec = listSpec;

            List <PaperCriteria> listCriteria = md.getPaperCriteria();

            ViewBag.listCriteria = listCriteria;

            List <ListCriteriaOfOnePaper> listCriteriaOne = pr.getCriteria(id);

            ViewBag.listCriteriaOne = listCriteriaOne;

            List <AuthorInfo> listAuthor = pr.getAuthorPaper(id);

            ViewBag.listAuthor   = listAuthor;
            ViewBag.numberAuthor = listAuthor.Count();

            List <DetailComment> listCmt = cr.getComment(request_id);

            ViewBag.cmt = listCmt;

            return(View());
        }