Пример #1
0
 public ActionResult FindByParams(PatentsView param, bool test = false)
 {
     ViewBag.UserName = AuthenticationManager.User.Identity.Name;
     if (!test)
     {
         _s = _patents.GetWithInclude(x => x.Inventor, x => x.Payment, x => x.Request, x => x.Request.State, x => x.Idea, x => x.Register);
     }
     if (param.PatentId != null)
     {
         _s = _s.Where(x => x.PatentId.ToString() == param.PatentId).Select(x => x);
     }
     if (param.StatementState != null)
     {
         _s = _s.Where(x => x.Request.State.Info == param.StatementState).Select(x => x);
     }
     if (param.InventorName != null)
     {
         _s = _s.Where(x => x.Inventor.FullName == param.InventorName).Select(x => x);
     }
     if (param.RegisterName != null)
     {
         _s = _s.Where(x => x.Register.FullName == param.RegisterName).Select(x => x);
     }
     if (param.Sum != null)
     {
         _s = _s.Where(x => x.Payment.Sum.ToString(CultureInfo.InvariantCulture) == param.Sum).Select(x => x);
     }
     return(View("PatentsTable", _s));
 }
Пример #2
0
        public static void PatentsViewTest()
        {
            var view = new PatentsView
            {
                InventorId     = "0",
                InventorName   = "south",
                RegisterName   = "vm",
                StatementState = "djkfv",
                PatentId       = "dkgjv",
                RegisterId     = "rg",
                Sum            = "16.00m"
            };

            Assert.Equal("16.00m", view.Sum);
        }