操作背包的工具类
Inheritance: MonoBehaviour
 public JsonController()
 {
     Result              = new Result();
     countryUtil         = new CountryUtil();
     stateUtil           = new StateUtil();
     areaUtil            = new AreaUtil();
     userUtil            = new UserUtil();
     subareaUtil         = new SubAreaUtil();
     appointmentTypeUtil = new AppointmentTypeUtil();
     currencyUtil        = new CurrencyUtil();
     dateFormatUtil      = new DateFormatUtil();
     languageUtil        = new LanguageUtil();
     religionUtil        = new ReligionUtil();
     durationDaysUtil    = new DurationDaysUtil();
     sourceUtil          = new SourceUtil();
     packageUtil         = new PackageUtil();
     cityUtil            = new CityUtil();
     //scoreColumnUtil = new ScoreColumnUtil();
     nationalityUtil = new NationalityUtil();
     timeFormatUtil  = new TimeFormatUtil();
     industryUtil    = new IndustryUtil();
     paymentModeUtil = new PaymentModeUtil();
     applicationTemplatePlaceHolderUtil = new ApplicationTemplatePlaceHolderUtil();
     jobTypeUtill        = new JobTypeUtill();
     jobStatusUtill      = new JobStatusUtill();
     packageTypeUtill    = new PackageTypeUtill();
     paperTypeUtill      = new PaperTypeUtill();
     paperSubTypeUtill   = new PaperSubTypeUtill();
     paymentStatusUtill  = new PaymentStatusUtill();
     currencyUtil        = new CurrencyUtil();
     leminationTypeUtill = new LeminationTypeUtill();
 }
        public ActionResult UpdatePackage(int packageid, company company)
        {
            try
            {
                packageUtil = new PackageUtil();
                package_subscription objsubscription = new package_subscription();
                var data = db.packages.AsEnumerable().Where(x => x.package_id == packageid).First();
                objsubscription.subscription_start_date = DateTime.Now;
                objsubscription.subscription_end_date   = DateTime.Now.AddDays(Convert.ToDouble(data.duration_days.duration_days_value));
                objsubscription.subscription_price      = data.setup_cost;
                objsubscription.subscription_discount   = 0;
                objsubscription.subscription_tax        = 0;
                objsubscription.user_id           = SessionUtil.GetUserID();
                objsubscription.per_user_price    = data.per_user_price;
                objsubscription.package_id        = data.package_id;
                objsubscription.duration_days_id  = data.duration_days_id;
                objsubscription.payment_status_id = 1;
                objsubscription.company_id        = company.company_id;
                result = packageUtil.Post_Package_Subscription(objsubscription);
                switch (result.MessageType)
                {
                case MessageType.Success:
                    return(RedirectToAction("EditCompany", "CompanySetting", new { id = company.company_id, Result = result.Message, MessageType = result.MessageType }));

                default:
                    return(RedirectToAction("Index", "CompanySetting", new { Result = result.Message, MessageType = result.MessageType }));
                }
            }
            catch
            {
                return(View());
            }
            return(View());
            //return RedirectToAction("Index", "Company", new { Result = result.Message, MessageType = result.MessageType });
        }
        public ActionResult updatepaymentstatus(string remark, string paid, string can, string package_subscription_id)
        {
            packageUtil = new PackageUtil();
            int val = Convert.ToInt32(package_subscription_id);
            package_subscription packageSubscription = new package_subscription();

            packageSubscription.package_subscription_id = val;
            if (paid != null && paid != "")
            {
                packageSubscription.payment_detail    = remark;
                packageSubscription.payment_status_id = Convert.ToInt32(paid);
            }
            if (can != null && can != "")
            {
                packageSubscription.cancel_remark     = remark;
                packageSubscription.payment_status_id = Convert.ToInt32(can);
            }
            result = packageUtil.Post_Package_Subscription(packageSubscription);
            switch (result.MessageType)
            {
            case MessageType.Success:
                return(RedirectToAction("Index", "CompanySetting", new { Result = result.Message, MessageType = result.MessageType }));

            default:
                return(RedirectToAction("Index", "CompanySetting", new { Result = result.Message, MessageType = result.MessageType }));
            }
        }
 //Design standard
 public static void RemovePackages(Validator val, PackageOverview overview)
 {
     if (val.removeAll)
     {
         foreach (Package i in overview.packages)
         {
             //It's redundant, but prevents spamming errors.
             if (PackageUtil.DoesPackageExist(i))
             {
                 Remove(i, val, overview);
             }
         }
     }
     else
     {
         foreach (string i in val.packageNames)
         {
             Package current = overview.GetPackageWithName(i);
             if (current != null)
             {
                 Remove(current, val, overview);
             }
             else
             {
                 Console.WriteLine(("WARNING: No package with name " + i + ".").Pastel("ffff00"));
             }
         }
     }
 }
Exemple #5
0
        public static void Main(string[] args)
        {
            byte[] file     = File.ReadAllBytes("/Users/ehardy/Documents/test-docs/one_page_document_standard_size.pdf");
            string fileName = System.IO.Path.GetFileName("C://path/to/file/document.pdf");

            // Create new esl client with api token and base url
            EslClient eslClient = new EslClient(apiToken, baseUrl);

            // Create a new package
            PackageId packageId = eslClient.PackageService.CreatePackage(PackageUtil.NewPackage());

            // Upload document to package
            eslClient.PackageService.UploadDocument(packageId, fileName, file, PackageUtil.CreateDocument());

            // Get the package
            Package package = eslClient.PackageService.GetPackage(packageId);

            // Send the package
            eslClient.PackageService.SendPackage(packageId);

            // Create a session token for signer
            // Access the session using the following url:
            SessionToken sessionToken = eslClient.SessionService.CreateSessionToken(packageId, PackageUtil.NewSigner());

            Console.WriteLine("http://stage-web.e-signlive.com/access?sessionToken=" + sessionToken.Token);

            // After the package is complete, you can download the documents

            // Download the zip file of all the documents in the package
            byte[]     bytes      = eslClient.PackageService.DownloadZippedDocuments(packageId);
            FileStream fileStream = new FileStream("C://path/to/save/file/document.pdf", FileMode.Create, FileAccess.ReadWrite);

            fileStream.Write(bytes, 0, bytes.Length);
            fileStream.Close();
        }
 //Design standard
 public static void UpdatePackages(Validator val, PackageOverview overview)
 {
     //If we update all with wildcard *. This method doesn't require a list of previous packages.
     if (val.updateAll)
     {
         foreach (Package i in overview.packages)
         {
             if (PackageUtil.DoesPackageExist(i))
             {
                 Update(i, val, overview).Wait();
             }
         }
     }
     //If we list packages
     else
     {
         foreach (string i in val.packageNames)
         {
             if (overview.GetPackageWithName(i) != null)
             {
                 Update(overview.GetPackageWithName(i), val, overview).Wait();
             }
             else
             {
                 Console.WriteLine(("WARNING: No package with name " + i + ".").Pastel("ffff00"));
             }
         }
     }
 }
        public async static Task Update(Package package, Validator val, PackageOverview overview)
        {
            //Create tmp dir so files are gone after execution.
            using (TmpDir dir = new TmpDir("."))
                using (WebClient client = new WebClient())
                {
                    //Check if it exists
                    if (PackageUtil.DoesPackageExist(package))
                    {
                        string filename = Path.GetFileName(package.downloadLocation);
                        Console.WriteLine("Getting newest version of package " + package.name);
                        //Setup loading bar
                        client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(LoadingBar.DownloadProgressCallback);
                        //Get latest version
                        await client.DownloadFileTaskAsync(package.downloadLink, dir.dirName + filename);

                        Console.Write("\n\r");
                        //Compare. The && ! will make it so that it will always go to 2nd case if val.forceUpdate is ture.
                        if (FileCompare.CompareFiles(dir.dirName + filename, "../sm_plugins/" + package.downloadLocation) && !val.forceUpdate)
                        {
                            Console.WriteLine(package.name + " is up to date.");
                        }
                        else
                        {
                            File.Move(dir.dirName + filename, "../sm_plugins/" + package.downloadLocation, true);
                            Console.WriteLine(package.name + " was updated.");
                        }
                    }
                    else
                    {
                        Console.WriteLine(("WARNING: Package " + package.name + " is not installed. Skipping.").Pastel("ffff00"));
                    }
                }
        }
        public MastersController()
        {
            result              = new Result();
            countryUtil         = new CountryUtil();
            stateUtil           = new StateUtil();
            cityUtil            = new CityUtil();
            areaUtil            = new AreaUtil();
            subareaUtil         = new SubAreaUtil();
            appointmentTypeUtil = new AppointmentTypeUtil();
            currencyUtil        = new CurrencyUtil();
            dateFormatUtil      = new DateFormatUtil();
            documentTypeUtil    = new DocumentTypeUtil();
            languageUtil        = new LanguageUtil();
            religionUtil        = new ReligionUtil();
            nationalityUtil     = new NationalityUtil();
            sourceUtil          = new SourceUtil();
            durationDaysUtil    = new DurationDaysUtil();
            packageUtil         = new PackageUtil();

            // scoreColumnUtil = new ScoreColumnUtil();
            timeFormatUtil  = new TimeFormatUtil();
            industryUtil    = new IndustryUtil();
            paymentModeUtil = new PaymentModeUtil();
            applicationTemplatePlaceHolderUtil = new ApplicationTemplatePlaceHolderUtil();
        }
 public CompanySettingController()
 {
     CompanyId   = SessionUtil.GetCompanyID();
     result      = new Result();
     companyUtil = new CompanyUtil();
     stateUtil   = new StateUtil();
     countryUtil = new CountryUtil();
     packageUtil = new PackageUtil();
 }
 public void _addItemTest()
 {
     for (int i = 0; i < 50; i++)
     {
         PackageUtil    target = new PackageUtil();           // TODO: 初始化为适当的值
         string         packId = "P130517131552064";          // TODO: 初始化为适当的值
         string         tnr    = "aaa1049910" + i.ToString(); // TODO: 初始化为适当的值
         ServiceMessage actual;
         actual = target._addItem(packId, tnr);
         //Thread.Sleep(2000);
     }
 }
Exemple #11
0
        public ActionResult UpdatePackage(int packageid, int company_id, int allow_users)
        {
            try
            {
                var     date        = DateTime.Now;
                decimal Total_Price = 0;

                var packagedatacount = db.package_subscription.AsEnumerable().Where(x => x.is_active && x.package_id == packageid && x.subscription_end_date >= date && x.company_id == CompanyId).FirstOrDefault();
                packageUtil = new PackageUtil();
                package_subscription objsubscription = new package_subscription();

                var data = db.packages.AsEnumerable().Where(x => x.package_id == packageid).First();
                objsubscription.subscription_start_date = DateTime.Now;
                objsubscription.subscription_end_date   = DateTime.Now.AddDays(Convert.ToDouble(data.duration_days.duration_days_value));
                objsubscription.allow_users             = allow_users;
                Total_Price = data.setup_cost + (data.per_user_price * allow_users);
                objsubscription.subscription_price          = Total_Price;//////////data.setup_cost; ///////////// Changed By Pravin
                objsubscription.subscription_discount       = 0;
                objsubscription.subscription_tax_display    = data.tax_display;
                objsubscription.subscription_tax_percentage = data.tax_percentage;
                objsubscription.subscription_tax            = Total_Price * ((data.tax_percentage) / 100); ///////0;
                objsubscription.user_id           = SessionUtil.GetUserID();
                objsubscription.setup_cost        = data.setup_cost;
                objsubscription.per_user_price    = data.per_user_price;
                objsubscription.package_id        = data.package_id;
                objsubscription.duration_days_id  = data.duration_days_id;
                objsubscription.payment_status_id = 1;
                objsubscription.company_id        = company_id;
                if (packagedatacount != null)
                {
                    objsubscription.package_subscription_id = packagedatacount.package_subscription_id;
                    objsubscription.payment_status_id       = packagedatacount.payment_status_id;
                }
                result = packageUtil.Post_Package_Subscription(objsubscription);
                switch (result.MessageType)
                {
                case MessageType.Success:
                    return(RedirectToAction("EditCompany", "Company", new { id = company_id, Result = result.Message, MessageType = result.MessageType }));

                default:
                    return(RedirectToAction("Index", "Company", new { Result = result.Message, MessageType = result.MessageType }));
                }
            }
            catch
            {
                return(View());
            }
            return(View());
            //return RedirectToAction("Index", "Company", new { Result = result.Message, MessageType = result.MessageType });
        }
 private static void Remove(Package package, Validator val, PackageOverview overview)
 {
     //Check if it exists.
     if (PackageUtil.DoesPackageExist(package))
     {
         Console.WriteLine("Removing package " + package.name);
         //Remove
         if (PackageUtil.DoesDirectoryExist(package))
         {
             File.Delete("../sm_plugins/" + package.downloadLocation);
         }
         else
         {
             Console.WriteLine("ERROR: sm_plugins and/or dependencies could not be found. Did you unzip all the app files into a folder at the same level as sm_plugins?".Pastel("ff0000"));
         }
     }
     else
     {
         Console.WriteLine(("WARNING: You have not installed " + package.name + ", skipping.").Pastel("ffff00"));
     }
 }
    void Package()
    {
        var temp = EditorUserBuildSettings.activeBuildTarget;

        EditorUserBuildSettings.SwitchActiveBuildTarget(PackagePlatform.GetBuildTarget());

        //切换贴图格式
        SwitchTextureFormat();

        //打包其他文件
        DefaultPackage.BuildDefaultSpecify(PackagePlatform.platformCurrent);


        //打包Assetbundle
        AssetBundlePackage.BuildAssetbundlesSpecify(PackagePlatform.platformCurrent);

        //打包场景
        if (needPackageScene)
        {
            PackagePlatform.sceneDirectoryPath = rawScenePath;
            SceneBundlePackage.BuildSceneSpecify(PackagePlatform.platformCurrent);
        }

        //生成版本号
        var minor = int.Parse(minorVersion);

        minor++;
        minorVersion = minor.ToString();
        PackageUtil.GeneratorVersion(mainVersion, minorVersion);

        //生成文件表
        PackageUtil.GeneratorChecklist();

        EditorUserBuildSettings.SwitchActiveBuildTarget(temp);
        SavePackageConfig();
    }
        private static async Task GetFile(Package package, PackageOverview overview, Validator val)
        {
            Console.WriteLine("Downloading " + package.name);
            //Download dependencies first
            foreach (string i in package.dependencies)
            {
                await GetFile(overview.GetPackageWithName(i), overview, val);
            }
            //Check if any incompatible package are installed
            bool incompat = false;

            foreach (string i in package.incompatibilities)
            {
                if (PackageUtil.DoesPackageExist(overview.GetPackageWithName(i)))
                {
                    bool res = Dialog.YNDialog(("WARNING: " + package.name + " is incompatiable with " + i + ". Would you like to remove the other package (Yes/No)? ").Pastel("ffff00"));
                    if (res)
                    {
                        Validator newVal = ClassCopy.DeepCopy(val);
                        newVal.packageNames = new List <string> {
                            i
                        };
                        Remover.RemovePackages(newVal, overview);
                    }
                    else
                    {
                        incompat = true;
                    }
                }
            }
            if (!incompat)
            {
                //Check if file already exists
                if (!PackageUtil.DoesPackageExist(package))
                {
                    using (WebClient client = new WebClient())
                    {
                        //Setup loading bar
                        client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(LoadingBar.DownloadProgressCallback);
                        //Download file to directory after checking if the folders existba
                        if (PackageUtil.DoesDirectoryExist(package))
                        {
                            await client.DownloadFileTaskAsync(package.downloadLink, "../sm_plugins/" + package.downloadLocation);

                            Console.Write("\n\r");
                        }
                        else
                        {
                            if (val.createDir)
                            {
                                Directory.CreateDirectory(Path.GetDirectoryName("../sm_plugins/" + package.downloadLocation));
                                await client.DownloadFileTaskAsync(package.downloadLink, "../sm_plugins/" + package.downloadLocation);

                                Console.Write("\n\r");
                            }
                            else
                            {
                                Console.WriteLine("ERROR: The folder to install to does not exist. Did you unzip all the app files into a folder at the same level as sm_plugins?".Pastel("ff0000"));
                            }
                        }
                    }
                }
                else
                {
                    Console.WriteLine(("WARNING: Plugin " + package.name + " is already installed, skipping.").Pastel("ffff000"));
                }
            }
        }
Exemple #15
0
 void Awake()
 {
     //改用单例
     packageUtil = PackageUtil.Instance;// GameObject.Find("UI_背包").GetComponent<PackageUtil>();
 }