public ActionResult ApiCreateDistributionGroup(string name, string description)
        {
            AndroidDistributionGroup androidDistributionGroup = new AndroidDistributionGroup(-1, name, description, DateTime.Now, DateTime.Now);

            androidDistributionGroup.Insert();
            return(this.Json(new { status = true, message = "Distribution group is created.." }));
        }
        public ActionResult ApiCreateDistribution(string name, string groupID, string description)
        {
            AndroidDistributionGroup androidDistributionGroup = AndroidDistributionGroup.CreateManager().Load(int.Parse(groupID));
            AndroidDistribution      androidDistribution      = new AndroidDistribution(-1, androidDistributionGroup, name, description, DateTime.Now, DateTime.Now);

            androidDistribution.Insert();
            return(RedirectToAction("AllDistribution", "Live", new { id = androidDistributionGroup.ID }));
            //return this.Json(new { status = true, message = "Distribution is created"});
        }
 public ActionResult OneDistributionGroup(string id)
 {
     Data.AndroidDistributionGroup model = AndroidDistributionGroup.CreateManager().Load(int.Parse(id));
     if (model == null)
     {
         return(this.Content("AndroidDistributionGroup is null"));
     }
     return(View("~/Views/Live/OneDistributionGroup.cshtml", model));
 }
        public ActionResult DistributionGroup()
        {
            DistributionGroupModel model = new DistributionGroupModel();

            model.DistributionGroups = AndroidDistributionGroup.CreateManager().Load();

            if (model == null)
            {
                return(this.Content("AndroidDistributionGroup is null"));
            }
            return(View(model));
        }
        public ActionResult ApiUpdateDistributionGroup(string id, string name, string description)
        {
            AndroidDistributionGroup androidDistributionGroup = AndroidDistributionGroup.CreateManager().Load(int.Parse(id));

            if (androidDistributionGroup == null)
            {
                return(this.Json(new { status = false, message = " Error parsing Distribution Group" }));
            }
            androidDistributionGroup.Name        = name;
            androidDistributionGroup.Description = description;
            androidDistributionGroup.Update();
            return(this.Json(new { status = true, message = "DistributionGroup is updated with values " + "Name: " + name + ", Description: " + description }, JsonRequestBehavior.AllowGet));
        }
        public ActionResult ApiDeleteDistributionGroup(string id)
        {
            Data.AndroidDistributionGroup   distributionGroup = AndroidDistributionGroup.CreateManager().Load(int.Parse(id));
            List <Data.AndroidDistribution> distributions     = Data.AndroidDistribution.CreateManager().Load(distributionGroup);

            foreach (Data.AndroidDistribution dist in distributions)
            {
                dist.Delete();
            }

            distributionGroup.Delete();
            return(RedirectToAction("DistributionGroup", "Live"));
        }
        public ActionResult CreateDistribution(string id)
        {
            int _gid = -1;

            if (!Int32.TryParse(id, out _gid))
            {
                return(this.Content("Could not parse id"));
            }

            AndroidDistributionGroup group = AndroidDistributionGroup.CreateManager().Load(_gid);

            if (group == null)
            {
                return(this.Content("Group is null"));
            }

            CreateDistributionModel model = new CreateDistributionModel();

            model.Group = group;
            return(View(model));
        }