public ActionResult Edit(string id, string editable)
        {
            ViewBag.title = "Chỉnh sửa khen thưởng bằng sáng chế";
            var pagesTree = new List <PageTree>
            {
                new PageTree("Chỉnh sửa khen thưởng bằng sáng chế", "/Invention/Edit"),
            };

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

            DetailInvention item = ir.getDetail(id);

            ViewBag.item = item;

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

            ViewBag.cmt = listCmt;

            List <Country> listCountry = ir.getCountry();

            ViewBag.listCountry = listCountry;

            List <AuthorInfo> listAuthor = ir.getAuthor(id);

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

            return(View());
        }
Esempio n. 2
0
        public DetailInvention getDetail(string id)
        {
            DetailInvention item = new DetailInvention();
            string          sql  = @"select i.*, it.name as 'type_name', ri.reward_type, ri.total_reward, ri.request_id
                            from [SM_ScientificProduct].Invention i join [SM_ScientificProduct].InventionType it on i.type_id = it.invention_type_id
	                            join [SM_ScientificProduct].RequestInvention ri on i.invention_id = ri.invention_id
                            where i.invention_id = @id";

            item = db.Database.SqlQuery <DetailInvention>(sql, new SqlParameter("id", id)).FirstOrDefault();
            return(item);
        }