Пример #1
0
        [HttpPost]/*, ValidateAntiForgeryToken]*/
        public ActionResult AddIntellectual(IntellectualModel model)
        {
            if (ModelState.IsValid && MainObject.CheckUserHasWriteAccess(model.MainId))
            {
                model.Save();

                return(PartialView("Partials/_intellectualList", IntellectualPropertyObject.GetIntellectualProperties(model.MainId)));
            }

            return(null);
        }
Пример #2
0
        public ActionResult RemoveIntellectual(int?id)
        {
            int mid = 0;

            if (id.HasValue)
            {
                var data = IntellectualPropertyObject.GetIntellectualProperty(id.Value);
                if (data != null)
                {
                    mid = data.MainId;
                    if (MainObject.CheckUserHasWriteAccess(mid))
                    {
                        data.Delete();
                    }
                }
            }

            return(PartialView("Partials/_intellectualList", IntellectualPropertyObject.GetIntellectualProperties(mid)));
        }
Пример #3
0
        public IntellectualModel(int mainId, int?intellectualId)
        {
            MainId        = mainId;
            Intellectuals = IntellectualPropertyObject.GetIntellectualProperties(MainId);

            if (intellectualId.HasValue)
            {
                var ip = IntellectualPropertyObject.GetIntellectualProperty(intellectualId.Value);
                if (ip != null)
                {
                    IntellectualPropertyId = ip.IntellectualPropertyId;
                    IdrNumber    = ip.IdrNumber;
                    DocketNumber = ip.DocketNumber;
                    Aty          = ip.Aty;
                    Ae           = ip.Ae;
                    Title        = ip.Title;
                }
            }
        }