Пример #1
0
        private void btnGuardar_Click(object sender, EventArgs e)
        {
            string token = Session.Token;

            dynamic contract = new System.Dynamic.ExpandoObject();

            contract.idUser = cmbUsers.SelectedValue;
            //contract.idUsers = Session.IdProfile;
            contract.expirationDate = Convert.ToDateTime(dtpFechaExpiracion.Value);
            contract.isValid        = 1; //1 -0
            if (Session.base64 != "")
            {
                contract.contractPath = Session.base64; //opcional
            }
            else
            {
                contract.contractPath = ""; //opcional
            }

            var saveContract = VirtualFairIntegration.CreateContract(token, contract);

            if (saveContract.statusCode == 201)
            {
                string text  = saveContract.message;
                string title = "Información";
                MessageBox.Show(text, title, MessageBoxButtons.OK, MessageBoxIcon.Information);

                var contracts = new Contracts();
                contracts.Show();

                this.Close();
            }
        }