Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 public static void Setup(int testItems)
 {
     SetTestRepo();
     for(int i=0;i<testItems;i++){
         PointDataSource item=new PointDataSource();
         _testRepo._items.Add(item);
     }
 }
Ejemplo n.º 3
0
 public static void Setup(PointDataSource item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }