Exemplo n.º 1
0
        private void DataGridInventario_CellEditEnding(object sender, System.Windows.Controls.DataGridCellEditEndingEventArgs e)
        {
            if (e.EditAction == DataGridEditAction.Commit)
            {
                var columna = e.Column as DataGridBoundColumn;
                if (columna != null)
                {
                    var bindingPath = (columna.Binding as Binding).Path.Path;
                    if (bindingPath == "noExistencias")
                    {
                        var celdaEditada = e.EditingElement as TextBox;
                        if (celdaEditada.Text.Contains(" "))
                        {
                            FuncionesComunes.MostrarMensajeDeError("No se han guardado los cambios.\n No se aceptan espacios vacios.");
                        }
                        else
                        {
                            Provision provisionEditada = dataGridInventario.SelectedCells[0].Item as Provision;
                            provisionEditada.activado      = true;
                            provisionEditada.noExistencias = FuncionesComunes.ParsearAEntero(celdaEditada.Text);

                            contexto = new InstanceContext(this);
                            EditarIngredienteClient serverEditarIngrediente = new EditarIngredienteClient(contexto);
                            serverEditarIngrediente.Editar(provisionEditada);
                        }
                    }
                }
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //Chain of responsibility
            string         actionToDownload = "08 OCTAVA";
            ActionProvider bossa            = new BossaProvider(actionToDownload);
            ActionProvider onet             = new OnetProvider(actionToDownload);

            bossa.SetNextActionProvider(onet);
            bossa.DoTask(TasksToDo.DownloadSingleAction);

            //Decorator Provision
            DownloadedAction da = new DownloadedAction(onet.actionModel);
            Provision        provisionDecorator = new Provision(da);
            double           decoratedPrice     = provisionDecorator.Price();

            Console.WriteLine($"TKO with Provision: {decoratedPrice} PLN");

            //Exchange Rate
            Console.WriteLine($"Today exchange rate: {CurrentExchangeRates.UsdRate()}");
            Console.WriteLine($"TKO with Provision: {CurrentExchangeRates.ConvertPlnToUSD(decoratedPrice)} USD");


            //BUILDER
            PostmanCompanyOne postmanCompanyOne = new PostmanCompanyOne();

            //POSTMAN CONFIGURE SETTINGS
            postmanCompanyOne.SetPort(587);
            postmanCompanyOne.SetHost(@"smtp.poczta.onet.pl");
            postmanCompanyOne.SetTimeOut(5000);
            postmanCompanyOne.SetDeliveryMethod();
            postmanCompanyOne.SetDefaultCredential();
            postmanCompanyOne.SetUserSettingsCredential("*****@*****.**", "Daniel123");
            postmanCompanyOne.SetMailFrom(@"*****@*****.**");
            postmanCompanyOne.SetMailTo(@"*****@*****.**");
            postmanCompanyOne.SetSubject($"ZTP-GIELDA Ceny Akcji {actionToDownload}");
            postmanCompanyOne.SetMailBody($"Nazwa Akcji: {actionToDownload}\r\n" +
                                          $"Cena Akcji bez prowizji: {onet.actionModel.Tko} \r\n" +
                                          $"Cena Akcji z prowizją: {decoratedPrice} \r\n" +
                                          $"Dzisiejsza cena Dolara: {CurrentExchangeRates.UsdRate()} \r\n" +
                                          $"Cena po przeliczeniu PLN-USD: {CurrentExchangeRates.ConvertPlnToUSD(decoratedPrice)}");
            //DIRECTOR
            EmailDirector director = new EmailDirector(postmanCompanyOne);

            //director.SendMail();
            Console.WriteLine(@"Email with Action Summary was send to [email protected]");
            SoundPlayer.Instance.PlaySound();

            //OBSERVER SETTINGS
            Provision observered = new Provision(provisionDecorator);

            SoundPlayer.Instance.SetObserveredAction(observered);
            Logger.Instance.SetObserveredAction(observered);
            observered.addObserver(SoundPlayer.Instance);
            observered.addObserver(Logger.Instance);

            //FAKE OBSERVER DATA
            FakeObserverData.Instance.GenerateFakeProvision(observered);
        }
 public void Ingrediente(Provision prov)
 {
     Dispatcher.Invoke(() =>
     {
         ingrediente = prov;
         EstablecerInformacion(ingrediente);
         EditarGuardarBtn.IsEnabled = true;
     });
 }
Exemplo n.º 4
0
        /// <summary>
        /// Provisions/destroys infrastructure.
        /// </summary>
        /// <param name="provision">The delegate to call after the infrastructure
        /// configuration has been loaded.</param>
        /// <param name="dryrun">Whether or not this is a dryrun.</param>
        private void Process(Provision provision, bool dryrun)
        {
            Validate();

            var platform       = LoadPlatform();
            var infrastructure = platform.Load(Yaml.GetRootNode());

            provision(platform, infrastructure, dryrun);
        }
 private void EstablecerInformacion(Provision provision)
 {
     IngredienteNombre.Text      = provision.nombre;
     IngredientePrecio.Text      = provision.costoUnitario.ToString();
     IngredienteUbicacion.Text   = provision.ubicacion;
     IngredienteExistencias.Text = provision.noExistencias.ToString();
     StockMinimo.Text            = provision.stockMinimo.ToString();
     UnidadMedidaCb.SelectedItem = provision.unidadMedida;
 }
Exemplo n.º 6
0
        public void AtualizarUltimoSinc(string phone)
        {
            Provision provision = db.Provision.FirstOrDefault(p => p.celular == phone);

            if (provision != null)
            {
                provision.lastSync = DateTime.Now;
                db.SaveChanges();
            }
        }
Exemplo n.º 7
0
        public void AtualizarVersaoAPP(string phone, string version)
        {
            Provision prov = db.Provision.FirstOrDefault(p => p.celular == phone);

            if (prov != null)
            {
                prov.version = version;
                db.SaveChanges();
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Name == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Name");
     }
     if (Version == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Version");
     }
     if (BuildVersion == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "BuildVersion");
     }
     if (UniqueIdentifier == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "UniqueIdentifier");
     }
     if (MinimumOsVersion == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "MinimumOsVersion");
     }
     if (Fingerprint == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Fingerprint");
     }
     if (PackageUrl == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "PackageUrl");
     }
     if (IpaUuids != null)
     {
         foreach (var element in IpaUuids)
         {
             if (element != null)
             {
                 element.Validate();
             }
         }
     }
     if (Provision != null)
     {
         Provision.Validate();
     }
     if (AppexProvisioningProfiles != null)
     {
         foreach (var element1 in AppexProvisioningProfiles)
         {
             if (element1 != null)
             {
                 element1.Validate();
             }
         }
     }
 }
Exemplo n.º 9
0
 public async Task Put([FromBody] Provision provision)
 {
     if (string.IsNullOrEmpty(provision.Content))
     {
         throw new ApplicationException("Provision must have content.");
     }
     using (var dataAccess = new MasterSideLetterDataAccess(_connectionStrings.MasterSideLetterDb))
     {
         await dataAccess.UpdateProvisionAsync(provision);
     }
 }
Exemplo n.º 10
0
 public async Task <int> Post([FromBody] Provision provision)
 {
     using (var dataAccess = new MasterSideLetterDataAccess(_connectionStrings.MasterSideLetterDb))
     {
         if (string.IsNullOrWhiteSpace(provision.Content))
         {
             return(0);
         }
         return(await dataAccess.CreateProvisionAsync(provision));
     }
 }
Exemplo n.º 11
0
        public void GetProvisions()
        {
            Provisions = new ObservableCollection <Provision>();

            using (SqlConnection connection = new SqlConnection(
                       Properties.Settings.Default.connectionString))
            {
                using (SqlCommand command = connection.CreateCommand())
                {
                    command.CommandType = System.Data.CommandType.StoredProcedure;
                    command.CommandText = "p_provisions_list";

                    SqlParameter dp = command.Parameters.Add("@UserId", SqlDbType.VarChar);
                    dp.Value = _user.Id;

                    connection.Open();

                    using (SqlDataReader dataReader = command.ExecuteReader())
                    {
                        if (dataReader.HasRows)
                        {
                            int idx_StartDate   = dataReader.GetOrdinal("StartDate");
                            int idx_Name        = dataReader.GetOrdinal("Name");
                            int idx_Description = dataReader.GetOrdinal("Description");
                            int idx_Id          = dataReader.GetOrdinal("Id");

                            while (dataReader.Read())
                            {
                                var provision = new Provision();
                                if (!dataReader.IsDBNull(idx_StartDate))
                                {
                                    provision.StartDate = dataReader.GetDateTime(idx_StartDate);
                                }
                                if (!dataReader.IsDBNull(idx_Name))
                                {
                                    provision.Name = dataReader.GetString(idx_Name);
                                }
                                if (!dataReader.IsDBNull(idx_Description))
                                {
                                    provision.Description = dataReader.GetString(idx_Description);
                                }
                                if (!dataReader.IsDBNull(idx_Id))
                                {
                                    provision.Id = dataReader.GetGuid(idx_Id);
                                }
                                Provisions.Add(provision);
                            }

                            provisionsList.ItemsSource = Provisions;
                        }
                    }
                }
            }
        }
 public async Task Handle(object command)
 {
     switch (command)
     {
     case ContextCommands.Provision cmd:
         var provisioner          = Provision.v0_7(cmd.Token);
         var ctx                  = ContextBuilder.fromScratch(cmd.WalletId, cmd.WalletKey, cmd.VerityApplicationEndpoint);
         var provisioningResponse = provisioner.provision(ctx);
         var context              = new Context(provisioningResponse);
         _repository.Add(context);
         break;
     }
 }
Exemplo n.º 13
0
        public ActionResult Create(Provision provision)
        {
            if (ModelState.IsValid)
            {
                db.Provisions.Add(provision);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.ApplicationId = new SelectList(db.Applications, "ApplicationId", "ApplicationName", provision.ApplicationId);
            ViewBag.CustomerId = new SelectList(db.Customers, "CustomerId", "CustomerName", provision.CustomerId);
            return View(provision);
        }
Exemplo n.º 14
0
        protected void ReadAssociations()
        {
            var driver = new SeparatedTextDriver();

            if (File.Exists(Export.PATH_ASSOCIATIONS))
            {
                _associations = TableReader.Read <XAssociation>(Export.PATH_ASSOCIATIONS, driver).ToDictionary(ass => ass.Key, ass => ass.Identifier);
                if (_associations.Count > 0)
                {
                    Provision.ContinueFrom(typeof(XUser), _associations.Max(pair => pair.Value));
                }
            }
        }
Exemplo n.º 15
0
        public static void ExportDatabases(IEnumerable <Student> students)
        {
            Export e = new Export();

            Provision.Clear();
            e.ReadAssociations();
            foreach (var student in students)
            {
                e.ExportUser(student);
            }
            e.WriteAssociations();
            e.WriteTables();
        }
Exemplo n.º 16
0
        public bool CheckSecurityKey(string phone, String securitykey)
        {
            bool isValid = false;

            logger.Debug("Repository.CheckSecurityKey [ phone : " + phone + " / securitykey: " + securitykey + " ]");
            Provision prov = db.Provision.FirstOrDefault(p => p.celular == phone && p.keyValue == securitykey);

            if (prov != null)
            {
                isValid = true;
            }

            logger.Debug("Repository.CheckSecurityKey [ phone : " + phone + " / isValid? : " + isValid + " ]");
            return(isValid);
        }
Exemplo n.º 17
0
        Context provisionAgent()
        {
            ProvisionV0_7 provisioner;

            if (consoleYesNo("Provide Provision Token", true))
            {
                string token = consoleInput("Token", Environment.GetEnvironmentVariable("TOKEN")).Trim();
                App.coloredConsoleOutput(token, "Using provision token: ");
                provisioner = Provision.v0_7(token);
            }
            else
            {
                provisioner = Provision.v0_7();
            }

            string verityUrl = consoleInput("Verity Application Endpoint", Environment.GetEnvironmentVariable("VERITY_SERVER")).Trim();

            if ("".Equals(verityUrl))
            {
                verityUrl = "http://localhost:9000";
            }

            App.coloredConsoleOutput(verityUrl, "Using Verity Application Endpoint Url: ");

            // create initial Context
            Context ctx = ContextBuilder.fromScratch("examplewallet1", "examplewallet1", verityUrl);

            // ask that an agent by provision (setup) and associated with created key pair
            Context provisioningResponse = null;

            try
            {
                provisioningResponse = provisioner.provision(ctx);
            }
            catch (ProvisionTokenException e)
            {
                App.consoleOutput(e.ToString());
                App.consoleOutput("Provisioning failed! Likely causes:");
                App.consoleOutput("- token not provided but Verity Endpoint requires it");
                App.consoleOutput("- token provided but is invalid or expired");

                throw new Exception();
            }

            return(provisioningResponse);
        }
Exemplo n.º 18
0
        public void createMessage()
        {
            Context context = TestHelpers.getContext();

            ProvisionV0_7 p   = Provision.v0_7();
            JsonObject    msg = p.provisionMsg(context);

            Assert.AreEqual(msg.getAsString("requesterVk"), context.SdkVerKey());


            string        goodToken = "{\"sponseeId\": \"myId\", \"sponsorId\": \"evernym-test-sponsorabc123\", \"nonce\": \"123\", \"timestamp\": \"2020-06-05T21:33:36.085Z\", \"sig\": \"ZkejifRr3txh7NrKokC5l2D2YcABUlGlAoFHZD9RapHHBfVtNnHgYux1RCAiEh4Q31VJE3C92T1ZnqDm1WlEAA==\", \"sponsorVerKey\": \"GJ1SzoWzavQYfNL9XkaJdrQejfztN4XqdsiV4ct3LXKL\"}";
            ProvisionV0_7 p2        = Provision.v0_7(goodToken);

            JsonObject msg2 = p2.provisionMsg(context);

            Assert.IsTrue(msg2.ContainsKey("provisionToken"));
        }
        private void RegistrarProductoExterno()
        {
            InstanceContext            context           = new InstanceContext(this);
            RegistrarIngredienteClient servicioProvision = new RegistrarIngredienteClient(context);

            try
            {
                Provision provision = new Provision
                {
                    nombre        = NombreTxt.Text,
                    costoUnitario = double.Parse(PrecioTxt.Text),
                    activado      = ProductoActivado(),
                    noExistencias = int.Parse(ExistenciasTxt.Text),
                    ubicacion     = UbicacionTxt.Text,
                    stockMinimo   = int.Parse(stockMinTxt.Text),
                    unidadMedida  = UnidadMedidaCb.SelectedItem.ToString(),
                };

                ProvisionDirecta provisionDirecta = new ProvisionDirecta
                {
                    descripcion   = DescripcionTxt.Text,
                    activado      = ProductoActivado(),
                    restricciones = RestriccionesTxt.Text,
                    Categoria     = new Categoria
                    {
                        categoria = CategoriaCb.SelectedItem.ToString()
                    }
                };

                servicioProvision.RegistrarProvisionDirecta(provision, provisionDirecta, imagenProducto);
            }
            catch (FormatException)
            {
                FuncionesComunes.MostrarMensajeDeError("Los campos marcados con * solo permiten números.");
            }
            catch (OverflowException)
            {
                FuncionesComunes.MostrarMensajeDeError("Algunos de los campos marcados con * sobrepasa el valor 32767.");
            }
            catch (Exception e)
            {
                FuncionesComunes.MostrarMensajeDeError(e.GetType() + ": " + e.Message);
            }
        }
Exemplo n.º 20
0
        public void GenerateFakeProvision(Provision observered)
        {
            Random rnd = new Random();

            Console.WriteLine($"Press any button to get random provision. Press 'q' to exit.");
            do
            {
                string key = Console.ReadLine();
                if (key == "q")
                {
                    break;
                }
                else
                {
                    observered.ChangeProvision(rnd.Next(1, 3));
                    observered.NotifyObservers();;
                }
            } while (true);
        }
Exemplo n.º 21
0
 /// <inheritdoc cref="object.ToString" />
 public override string ToString()
 {
     return(string.Format
            (
                "Number: {0}, Name: {1}, Password: {2}, "
                + "Cataloger: {3}, Reader: {4}, Circulation: {5}, "
                + "Acquisitions: {6}, Provision: {7}, "
                + "Administrator: {8}",
                Number.ToVisibleString(),
                Name.ToVisibleString(),
                Password.ToVisibleString(),
                Cataloger.ToVisibleString(),
                Reader.ToVisibleString(),
                Circulation.ToVisibleString(),
                Acquisitions.ToVisibleString(),
                Provision.ToVisibleString(),
                Administrator.ToVisibleString()
            ));
 }
Exemplo n.º 22
0
        public ActionResult <IEnumerable <ProvisionDTO> > Provision([FromBody] ProvisionDTO provisionDTO)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest());
            }

            if (provisionDTO == null)
            {
                return(BadRequest());
            }

            var checkProvisiondinDb = _choiceRepoistory.GetProvisions().Find(c => c.ProvisionId == provisionDTO.ProvisionId);

            if (checkProvisiondinDb != null)
            {
                return(BadRequest());
            }

            Provision newlyProvision = new Provision()
            {
                ProvisionId    = provisionDTO.ProvisionId,
                CRMPartnerId   = provisionDTO.CRMPartnerId,
                CustomerId     = provisionDTO.CustomerId,
                BookingId      = provisionDTO.BookingId,
                Price          = provisionDTO.Price,
                CreatedDate    = System.DateTime.Now,
                DateofShipment = provisionDTO.DateofShipment,
                Debtor         = provisionDTO.Debtor,
                ProvisionName  = provisionDTO.ProvisionName,
                UnitID         = provisionDTO.UnitID,
                CreatedBy      = provisionDTO.CreatedBy,
                ProvisionSpID  = provisionDTO.ProvisionSpID,
                LastModified   = provisionDTO.LastModified,
                LastModifiedBy = provisionDTO.LastModifiedBy,
            };

            _choiceRepoistory.SetProvision(newlyProvision);
            _choiceRepoistory.Complete();

            return(CreatedAtRoute("GetProvisions", new { name = newlyProvision.ProvisionName }, newlyProvision));
        }
Exemplo n.º 23
0
 public void IncludeShortTitle(Legislation legislation)
 {
     if (legislation.ShortTile.ToString().Length >= 5)
     {
         string shortTitle = "This Act may be cited as the <i>" + legislation.ShortTile.ToString() + "</i>.";
         var provision = new Provision
         {
             Article = Numbers.CountOrNull(legislation.Provisions) + 1,
             Proponent = legislation.Sponsor,
             Text = shortTitle,
             Enactment = new Enactment
             {
                 EnactingOrder = null,
                 EnactmentType = 1,
                 EnactingDate = DateTime.MaxValue
             }
         };
         legislation.Provisions.Add(provision);
         db.SaveChanges();
     }
 }
Exemplo n.º 24
0
        public Provision creerProvision(DateTime _dateOperation)
        {
            // Récupération des modèles actifs
            var _modele = uow.ModeleProvision
                .GetUnique(groupeId)
                ;

            if (_modele != null)
            {

                Provision provision = new Provision();
                provision.DateSaisie = _dateOperation;
                provision.DateMAJ = DateTime.Now;
                provision.GroupeId = groupeId;
                provision.Active = true;

                provision.Mouvements = new List<MouvementBudget>();
                _modele.Mouvements.ToList().ForEach(mo => provision.Mouvements.Add(
                    creerMouvement(mo, groupeId, _dateOperation)
                    ));

                // Renumérotation des ids des mouvements
                var counter = 0;
                foreach (var item in provision.Mouvements.ToList())
                {
                    counter = counter + 1;
                    item.Id = counter;
                }

                return provision;

            }
            else
            {
                return this.creerProvisionSansMouvement(_dateOperation);
            }
        }
Exemplo n.º 25
0
        public ContenedorProvisiones LlamarSPRescatar(string token)
        {
            ContenedorProvisiones LProvisiones = new ContenedorProvisiones();

            if (ValidarPerfilCUD(token))
            {
                try
                {
                    CapaDato.EntitiesBBDDHostel conex = new CapaDato.EntitiesBBDDHostel();

                    var collection = conex.PROVISION.OrderBy(p => p.RUT_PROVEEDOR).ToList();

                    foreach (var item in collection)
                    {
                        Provision n = new Provision();
                        n.RutProveedor   = item.RUT_PROVEEDOR;
                        n.CodigoProducto = item.CODIGO_PRODUCTO;
                        n.Precio         = item.PRECIO;
                        LProvisiones.Lista.Add(n);
                    }
                    LProvisiones.Retorno.Codigo = 0;
                    LProvisiones.Retorno.Glosa  = "OK";
                }
                catch (Exception)
                {
                    LProvisiones.Retorno.Codigo = 1011;
                    LProvisiones.Retorno.Glosa  = "Err codret ORACLE";
                }
            }
            else
            {
                LProvisiones.Retorno.Codigo = 100;
                LProvisiones.Retorno.Glosa  = "Err expiro sesion o perfil invalido";
            }

            return(LProvisiones);
        }
Exemplo n.º 26
0
        private void StartProvision()
        {
            List <CMS2.Client.SyncHelper.ThreadState> listOfState = new List <CMS2.Client.SyncHelper.ThreadState>();
            SqlConnection localConnection = new SqlConnection(_localConnectionString.Replace("master", _localDbName));
            SqlConnection mainConnection  = new SqlConnection(_mainConnectionString);

            foreach (SyncTables table in _entities)
            {
                CMS2.Client.SyncHelper.ThreadState state = new CMS2.Client.SyncHelper.ThreadState();
                state.table  = table;
                state.worker = Worker;
                listOfState.Add(state);

                try
                {
                    Provision provision = new Provision(table.TableName, localConnection, mainConnection, state._event, _filter, _branchCorpOfficeId);
                    ThreadPool.QueueUserWorkItem(new WaitCallback(provision.PrepareDatabaseForSynchronization), state);
                    state._event.WaitOne();
                }
                catch (Exception ex)
                {
                }
            }
        }
Exemplo n.º 27
0
        public int Include(NewProvisionView article, int bill)
        {
            var legislation = db.Legislations.Find(bill);

            if (legislation != null)
            {
                try
                {
                    var provision = new Provision
                    {
                        Article = Numbers.CountOrNull(legislation.Provisions) + 1,
                        Text = article.Text,
                        Enactment = new Enactment
                        {
                            EnactmentType = 1,
                            EnactingOrder = null,
                            EnactingDate = DateTime.Parse(article.EnactingDate)
                        },
                        Proponent = db.Members.SingleOrDefault(m => m.Username == HttpContext.Current.User.Identity.Name)
                    };

                    legislation.Provisions.Add(provision);
                    db.SaveChanges();

                    return provision.ProvisionID;
                }
                catch (Exception)
                {
                    return 0;
                }
            }
            else
            {
                return 0;
            }
        }
Exemplo n.º 28
0
        static void Main(string[] args)
        {
            provisionForm frm = new provisionForm();
            frm.ShowDialog();
            string vendorname = frm.vendorname;
            string vendortoken = frm.vendortoken;
            string clonecik = frm.clonecik;
            string cloneportalcik = frm.cloneportalcik; //use only if managing by sharecode
            string portalcik = frm.portalcik;

            int r = new Random().Next(1, 10000000);
            string model = "MyTestModel" + r.ToString();
            string sn1 = "001" + r.ToString();
            string sn2 = "002" + r.ToString();
            string sn3 = "003" + r.ToString();
            OnepV1 op = new OnepV1("https://m2.exosite.com/onep:v1/rpc/process", 3);
            Result portalridResult = op.lookup(portalcik, "alias", "");
            string portalrid = null;
            string clonerid = null;
            if (portalridResult.status == Result.OK)
            {
                portalrid = portalridResult.message;
                Console.WriteLine("\r\nportalrid: " + portalrid);
            }
            else Console.WriteLine("\r\nFailed to look up portal RID");
            Result cloneridResult = op.lookup(clonecik, "alias", "");
            Provision provision = null;
            if (cloneridResult.status == Result.OK)
            {
                clonerid = cloneridResult.message;
                Console.WriteLine("\r\nclonerid: " + clonerid);
                provision = new Provision("https://m2.exosite.com", 3, false, true);
            }
            else Console.WriteLine("\r\nFailed to look up clone RID");
            Dictionary<string, string> meta = new Dictionary<string, string>();
            string[] options = new string[2];
            options[0] = vendorname;
            options[1] = model;
            string option = "[" + "\"" + vendorname + "\"" + ", " + "\"" + model + "\"" + "]";
            meta.Add("meta", option);
            string sharecode = op.share(cloneportalcik, clonerid, meta).message;
            try
            {
                Console.WriteLine("\r\nmodel_create()");
                Console.WriteLine("\r\n" + provision.model_create(vendortoken, model, sharecode, false, true, true).message);
                Console.WriteLine("\r\nmodel_list()\r\n"+provision.model_list(vendortoken).message);
                Console.WriteLine("\r\nmodel_info()\r\n" + provision.model_info(vendortoken, model).message);
                Console.WriteLine("\r\nserialnumber_add()");
                Console.WriteLine("\r\n" + provision.serialnumber_add(vendortoken, model, sn1).message);
                Console.WriteLine("\r\nserialnumber_add_batch()");
                string[] sn2andsn3 = new string[2];
                sn2andsn3[0] = sn2;
                sn2andsn3[1] = sn3;
                Console.WriteLine("\r\n" + provision.serialnumber_add_batch(vendortoken, model, sn2andsn3).message);
                Console.WriteLine("\r\nserialnumber_list()\r\n" + provision.serialnumber_list(vendortoken, model, 0, 10).message);
                Console.WriteLine("\r\nserialnumber_remove_batch()");
                Console.WriteLine("\r\n" + provision.serialnumber_remove_batch(vendortoken, model, sn2andsn3).message);
                Console.WriteLine("\r\nserialnumber_list()\r\n" + provision.serialnumber_list(vendortoken, model, 0, 1000).message);
                Console.WriteLine("\r\nserialnumber_enable()");
                provision.serialnumber_enable(vendortoken, model, sn1, portalrid); //return clientid
                Console.WriteLine("\r\nAFTER ENABLE: " + provision.serialnumber_info(vendortoken, model, sn1).message);
                Console.WriteLine("\r\nserialnumber_disable()");
                provision.serialnumber_disable(vendortoken, model, sn1);
                Console.WriteLine("\r\nAFTER DISABLE: " + provision.serialnumber_info(vendortoken, model, sn1).message);
                Console.WriteLine("\r\nserialnumber_reenable()");
                provision.serialnumber_reenable(vendortoken, model, sn1);
                Console.WriteLine("\r\nAFTER REENABLE: " + provision.serialnumber_info(vendortoken, model, sn1).message);
                Console.WriteLine("\r\nserialnumber_activate()");
                //return client key
                string sn_cik = provision.serialnumber_activate(model, sn1, vendorname).message;
                Console.WriteLine("\r\nAFTER ACTIVATE: " + provision.serialnumber_info(vendortoken, model, sn1).message);

                Console.WriteLine("\r\ncontent_create()");
                Console.WriteLine("\r\n" + provision.content_create(vendortoken, model, "a.txt", "This is text", false).message);
                Console.WriteLine("\r\ncontent_upload()");
                Console.WriteLine("\r\n" + provision.content_upload(vendortoken, model, "a.txt", "This is content data", "text/plain").message);
                Console.WriteLine("\r\ncontent_list()\r\n" + provision.content_list(vendortoken, model).message);
                Console.WriteLine(vendortoken, model, "a.txt");
                Console.WriteLine("\r\ncontent_remove()");
                provision.content_remove(vendortoken, model, "a.txt");

                Console.WriteLine("\r\nmodel_remove()");
                provision.model_remove(vendortoken, model);
            }
            catch (ProvisionException e)
            {
                Console.WriteLine("\r\nprovisionExample sequence exception:");
                Console.WriteLine(e.Message);
            }
        }
Exemplo n.º 29
0
 public ActionResult Edit(Provision provision)
 {
     if (ModelState.IsValid)
     {
         db.Entry(provision).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.ApplicationId = new SelectList(db.Applications, "ApplicationId", "ApplicationName", provision.ApplicationId);
     ViewBag.CustomerId = new SelectList(db.Customers, "CustomerId", "CustomerName", provision.CustomerId);
     return View(provision);
 }
Exemplo n.º 30
0
 public ActionResult Edit(Provision provision)
 {
     if (ModelState.IsValid)
     {
         db.Entry(provision).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(provision);
 }
Exemplo n.º 31
0
        // Fabrique des mouvements
        // Mouvements à venir
        private IEnumerable<MouvementBudget> CalculerMouvementsAVenir(Budget _budget)
        {
            // Init liste des mouvements
            IList<MouvementBudget> mouvementsAVenir = new List<MouvementBudget>();

            if (_budget.MontantProvisionCourante != 0)
            {
                // Fabrique provision
                var fabrique = new ProvisionFabrique(uow, ProfileUser.GroupeId);

                // Récupération de la date de la dernère provision
                DateTime _dateDerniereProvision = uow.Provision.GetDateDerniereProvision(ProfileUser.GroupeId);

                // Calcul des péridoes à venir
                _budget.CalculerPeriodesFinancementRestantes(_dateDerniereProvision);

                // Date de départ
                DateTime dateProv = _dateDerniereProvision;

                // Calcul des mouvements provisions à venir
                int nbPeriodesAVenir = _budget.PeriodeFinancementRestante;
                for (int i = 0; i < nbPeriodesAVenir; i++)
                {
                    DateTime dateMouvement = dateProv.AddMonths(i + 1);

                    MouvementBudget mouv = fabrique
                        .creerMouvementAVenirFromProvisionBudget(dateMouvement, _budget);

                    mouv.Id = -i;

                    // Calcul de la provision
                    Provision _prov = new Provision
                    {
                        DateSaisie = dateMouvement,
                        Active = true,
                        Archivee = false,
                        GroupeId = ProfileUser.GroupeId,
                        Id = -i
                    };

                    mouv.Provision = _prov;

                    mouvementsAVenir.Add(mouv);
                }

            }            // Retour
            return mouvementsAVenir;
        }
Exemplo n.º 32
0
 public void SetProvision(Provision provision)
 {
     _dbContext.provision.Add(provision);
 }
Exemplo n.º 33
0
 //
 public void SetObserveredAction(Provision p)
 {
     this.provisionObservered = p;
 }
        public static async Task UpdateProvisionAsync(this MasterSideLetterDataAccess dataAccess, Provision provision)
        {
            if (string.IsNullOrWhiteSpace(provision.ProvisionType))
            {
                provision.ProvisionType = null;
            }

            await dataAccess.ExecuteAsync(@"update Provision set FundInvestorId = @FundInvestorId, ProvisionType = @ProvisionType, IsProvisionTypeInherited = @IsProvisionTypeInherited, Content = @Content, Notes = @Notes, ModifiedDate = getdate() where Id = @Id", provision);
        }
 public static async Task <int> CreateProvisionAsync(this MasterSideLetterDataAccess dataAccess, Provision provision)
 {
     return(await dataAccess.ExecuteScalarAsync <int>(@"insert Provision (FundInvestorId, ProvisionType, Content , Notes) output inserted.Id values(@FundInvestorId, @ProvisionType, @Content, @Notes)", provision));
 }
Exemplo n.º 36
0
 public static decimal GetExpertProvision(Provision provision)
 {
     return(provision.ProvisionValue);
 }
Exemplo n.º 37
0
        /// <summary>
        /// Serialize to a JSON object
        /// </summary>
        public new void SerializeJson(Utf8JsonWriter writer, JsonSerializerOptions options, bool includeStartObject = true)
        {
            if (includeStartObject)
            {
                writer.WriteStartObject();
            }

            if (!string.IsNullOrEmpty(ResourceType))
            {
                writer.WriteString("resourceType", (string)ResourceType !);
            }


            ((Fhir.R4.Models.DomainResource) this).SerializeJson(writer, options, false);

            if ((Identifier != null) && (Identifier.Count != 0))
            {
                writer.WritePropertyName("identifier");
                writer.WriteStartArray();

                foreach (Identifier valIdentifier in Identifier)
                {
                    valIdentifier.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (!string.IsNullOrEmpty(Status))
            {
                writer.WriteString("status", (string)Status !);
            }

            if (_Status != null)
            {
                writer.WritePropertyName("_status");
                _Status.SerializeJson(writer, options);
            }

            if (Scope != null)
            {
                writer.WritePropertyName("scope");
                Scope.SerializeJson(writer, options);
            }

            if ((Category != null) && (Category.Count != 0))
            {
                writer.WritePropertyName("category");
                writer.WriteStartArray();

                foreach (CodeableConcept valCategory in Category)
                {
                    valCategory.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Patient != null)
            {
                writer.WritePropertyName("patient");
                Patient.SerializeJson(writer, options);
            }

            if (!string.IsNullOrEmpty(DateTime))
            {
                writer.WriteString("dateTime", (string)DateTime !);
            }

            if (_DateTime != null)
            {
                writer.WritePropertyName("_dateTime");
                _DateTime.SerializeJson(writer, options);
            }

            if ((Performer != null) && (Performer.Count != 0))
            {
                writer.WritePropertyName("performer");
                writer.WriteStartArray();

                foreach (Reference valPerformer in Performer)
                {
                    valPerformer.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if ((Organization != null) && (Organization.Count != 0))
            {
                writer.WritePropertyName("organization");
                writer.WriteStartArray();

                foreach (Reference valOrganization in Organization)
                {
                    valOrganization.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (SourceAttachment != null)
            {
                writer.WritePropertyName("sourceAttachment");
                SourceAttachment.SerializeJson(writer, options);
            }

            if (SourceReference != null)
            {
                writer.WritePropertyName("sourceReference");
                SourceReference.SerializeJson(writer, options);
            }

            if ((Policy != null) && (Policy.Count != 0))
            {
                writer.WritePropertyName("policy");
                writer.WriteStartArray();

                foreach (ConsentPolicy valPolicy in Policy)
                {
                    valPolicy.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (PolicyRule != null)
            {
                writer.WritePropertyName("policyRule");
                PolicyRule.SerializeJson(writer, options);
            }

            if ((Verification != null) && (Verification.Count != 0))
            {
                writer.WritePropertyName("verification");
                writer.WriteStartArray();

                foreach (ConsentVerification valVerification in Verification)
                {
                    valVerification.SerializeJson(writer, options, true);
                }

                writer.WriteEndArray();
            }

            if (Provision != null)
            {
                writer.WritePropertyName("provision");
                Provision.SerializeJson(writer, options);
            }

            if (includeStartObject)
            {
                writer.WriteEndObject();
            }
        }
Exemplo n.º 38
0
 public Terminal(Provision provision)
     : base(provision.Name)
 {
     Provision = provision;
 }
Exemplo n.º 39
0
        private Provision creerProvisionSansMouvement(DateTime _dateOperation)
        {
            Provision provision = new Provision();
            provision.DateSaisie = _dateOperation;
            provision.DateMAJ = DateTime.Now;
            provision.GroupeId = groupeId;
            provision.Active = true;

            return provision;
        }