示例#1
0
        private static void Main(string[] args)
        {
            var packagesRepository = new PackageRepository();

            Parser.Default
            .ParseArguments <Options>(args)
            .WithParsed(o =>
            {
                foreach (var package in FilesScanner.GetAllPackages(new [] { o.RepositoryPath }, false))
                {
                    packagesRepository.AddPackage(package);
                }

                var localPackages      = FilesScanner.GetAllPackages(new [] { o.Path }, true);
                var structureValidator = new StructureValidator();

                var validationErrors = structureValidator.ValidateStructure(localPackages);
                foreach (var validationError in structureValidator.ValidateStructure(localPackages))
                {
                    Console.WriteLine(validationError);
                }

                if (validationErrors.Any())
                {
                    return;
                }

                HandleVersionSynchronization(localPackages);
                HandleCycles(FilesScanner.GetAllPackages(new [] { o.Path }, true), packagesRepository, o.Target);

                localPackages        = FilesScanner.GetAllPackages(new [] { o.Path }, true);
                var resolvedPackages = ResolvePackages(PackageRepository.Create(localPackages), packagesRepository, o.Target);
                Run(resolvedPackages);
            });
        }
示例#2
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                Package objPkg = new Package();

                if (Request.QueryString["Id"] != null)
                {
                    objPkg.Id = Guid.Parse(Request.QueryString["Id"].ToString());
                }
                else
                {
                    objPkg.Id = Guid.NewGuid();
                }

                objPkg.PackageName = txtPackage.Text;
                objPkg.Pricing     = double.Parse(txtPricing.Text);
                objPkg.EntryDate   = DateTime.Now;
                objPkg.Status      = true;//bool.Parse(ddltatus.SelectedValue);
                if (objPkgRepo.checkPackageExists(objPkg.Id))
                {
                    objPkgRepo.UpdatePackage(objPkg);
                }
                else
                {
                    objPkgRepo.AddPackage(objPkg);
                }
                Response.Redirect("ManagePackage.aspx");
            }
            catch (Exception Err)
            {
                logger.Error(Err.Message);
                Response.Write(Err.StackTrace);
            }
        }
示例#3
0
        public ActionResult CreatePackage()
        {
            PackageDetails packageDetails = new PackageDetails();

            UpdateModel(packageDetails);
            package.AddPackage(packageDetails);
            TempData["Message"] = "Package added";
            return(RedirectToAction("Index"));
        }
示例#4
0
 public string AddPackage(string ObjPackage)
 {
     try
     {
         Domain.Myfashion.Domain.Package objPackage = (Domain.Myfashion.Domain.Package)(new JavaScriptSerializer().Deserialize(ObjPackage, typeof(Domain.Myfashion.Domain.Package)));
         objPackagerepo.AddPackage(objPackage);
         return(new JavaScriptSerializer().Serialize("Package Added Successfully"));
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.StackTrace);
         return(null);
     }
 }
示例#5
0
        public ActionResult Create(PackageVM model)
        {
            try
            {
                string packageId = string.Empty;
                model.CreatedBy = LogInManager.LoggedInUserId;

                packageId = packageRepository.AddPackage(model);

                if (!string.IsNullOrWhiteSpace(packageId))
                {
                    return(Json(new
                    {
                        IsSuccess = true,
                        data = new
                        {
                            PackageId = packageId
                        }
                    }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new
                    {
                        IsSuccess = false,
                        errorMessage = "Package details not saved successfully."
                    }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception e)
            {
                Utility.Utility.LogError(e, "Create");
                return(Json(new
                {
                    IsSuccess = false,
                    errorMessage = e.Message
                }));
            }
        }
 public void AddPackage(TouristPackage oTourist)
 {
     ListPackage.AddPackage(oTourist);
 }
示例#7
0
        public void AddPackage(string description, DateTime checkOut, DateTime checkIn, int quantity, double import)
        {
            TouristPackage oTourist = new TouristPackage(quantity, import, description, checkOut, checkIn);

            ListPackage.AddPackage(oTourist);
        }