예제 #1
0
 public ActionResult CreateSource(string title, string updated, string description, string authorname, string authoremail, string boundary, string active)
 {
     try
     {
         var newSource = new PointDataSource()
         {
             Title = title,
             UpdatedOn = DateTime.Parse(updated),
             Description = description,
             AuthorName = authorname,
             AuthorEmail = authoremail,
             BoundaryPolygon = boundary,
             Active = bool.Parse(active),
             CreatedOn = DateTime.UtcNow,
             UniqueId = Guid.NewGuid().ToString()
         };
         newSource.Save();
     }
     catch (Exception)
     {
         return Json("error", JsonRequestBehavior.AllowGet);
     }
     return Json("success", JsonRequestBehavior.AllowGet);
 }
예제 #2
0
 public static void Setup(int testItems)
 {
     SetTestRepo();
     for(int i=0;i<testItems;i++){
         PointDataSource item=new PointDataSource();
         _testRepo._items.Add(item);
     }
 }
예제 #3
0
 public static void Setup(PointDataSource item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }