예제 #1
0
파일: Category.cs 프로젝트: hanoitown/vnsf
 public static Category Create(string name, string description, int displayOrder, int depth, Classification clas, Category parent)
 {
     return new Category()
     {
         Id = Guid.NewGuid(),
         Name = name,
         Description = description,
         DisplayOrder = displayOrder,
         Depth = depth,
         Classification = clas,
         Parent = parent
     };
 }
예제 #2
0
파일: Grant.cs 프로젝트: hanoitown/vnsf
 public static Grant NewGrant(string code, string name, string description, string objective, string scope, bool isActive, long total, Classification clas)
 {
     return new Grant()
     {
         Id = Guid.NewGuid(),
         Code = code,
         Name = name,
         Description = description,
         Objective = objective,
         Scope = scope,
         IsActive = isActive,
         Total = total,
         Classification = clas
     };
 }
예제 #3
0
        public ActionResult Create(Classification classification)
        {
            try
            {
                // TODO: Add insert logic here
                if (ModelState.IsValid)
                {
                    var cs = new Classification();
                    cs.Id = Guid.NewGuid();
                    cs.Name = classification.Name;
                    cs.Description = classification.Description;

                    _uow.ClassificationRepo.Add(cs);
                    _uow.Save();
                }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }