Example #1
0
        private PartialViewResult ViewDeleteGrant(Grant grant, ConfirmDialogFormViewModel viewModel)
        {
            var confirmMessage = $"Are you sure you want to delete this {FieldDefinition.Grant.GetFieldDefinitionLabel()} '{grant.GrantTitle}'?";
            var viewData       = new ConfirmDialogFormViewData(confirmMessage, true);

            return(RazorPartialView <ConfirmDialogForm, ConfirmDialogFormViewData, ConfirmDialogFormViewModel>(viewData, viewModel));
        }
Example #2
0
        public ActionResult Create([Bind(Include = "Product, GrantDecision, Amount")] Grant grant)
        {
            Db db = new Db(DbServices.ConnectionString);

            if (ModelState.IsValid)
            {
                try
                {
                    GrantServices.Insert(CurrentUser.Id, grant, db);
                    TempData["Success"] = ResourceServices.GetString(Cf.Data.Resources.ResourceBase.Culture, "UI", "InsertConfirmed");
                    return(RedirectToAction("Index"));
                }
                catch (CfException cfex)
                {
                    TempData["Failure"] = cfex.ErrorDefinition.LocalizedMessage;
                }
                catch (Exception ex)
                {
                    TempData["Failure"] = ex.Message;
                }
            }

            ViewBag.GrantDecisionList = new SelectList(GrantDecisionServices.List(db), "Id", "CersNumber");
            ViewBag.ProductList       = new SelectList(ProductServices.List(db), "Id", "Notes");
            return(View(grant));
        }
Example #3
0
        public MultipleClaimMatchAssertion(Grant grant, MultipleMatchMode mode, params Claim[] claims)
        {
            if (claims.Length == 0)
            {
                throw new ArgumentException("Value cannot be an empty collection.", nameof(claims));
            }


            _mode   = mode;
            Grant   = grant;
            _claims = claims.OrderBy(x => x.Type).ToArray();
            var sb = new StringBuilder();

            foreach (var claim in _claims)
            {
                sb.AppendLine($"{claim.Type} {claim.Value}");
            }

            var assertion = sb.ToString();

            Information = mode switch {
                MultipleMatchMode.All => new AssertionInformation("all", assertion, grant),
                MultipleMatchMode.Any => new AssertionInformation("any", assertion, Grant),
                MultipleMatchMode.None => new AssertionInformation("none", assertion, Grant),
                _ => throw new ArgumentOutOfRangeException(nameof(mode))
            };
        }
        public async Task VoteReject(string grantId)
        {
            Grant grant = await eh.GetCurrentGrantStatus(grantId, httpClient);

            // e.g. string url = "https://myAzureWebsiteAzureFunctions.azurewebsites.net/api/VoteReject";
            string url = "https://grantsentitiesexample.azurewebsites.net/api/VoteReject?code=wXQPG39aJZlZEQkxBN4C46NJQiefbdx7O1oiVQ39Cn9Tm0jmR4QTvA==";

#if DEBUG
            url = "http://localhost:7071/api/VoteReject";
#endif
            string username = Context.User?.Identity?.Name ?? "anonymous";
            HttpResponseMessage?response = await httpClient.PostAsJsonAsync(url, new NewVote { GrantId = grantId, Username = username });

            if (response?.IsSuccessStatusCode ?? false)
            {
                GetVoteNames(grant, out List <string> approveNames, out List <string> rejectNames);
                await Clients.All.SendAsync("UpdateCount",
                                            grantId,
                                            grant.ApproveCount,
                                            ++grant.RejectCount,
                                            approveNames,
                                            string.Join(", ", rejectNames.Concat(new string[] { username.Split('.').First() })));
            }
            else
            {
                throw new Exception();
            }
        }
Example #5
0
        public Grant AddGrant(Grant gr)
        {
            AddAuthors(gr.Participants.Select(a => a.Name).ToList());
            var res = _unitOfWork.GrantRepository.Create(gr);

            return(res);
        }
Example #6
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            int grantId = 0;

            Int32.TryParse(lblGrantId.Text, out grantId);

            //Grant grant = MyGrant as Grant;
            Grant newGrant = GetGrant(grantId);

            grantId = mgr.SaveGrant(grantId, newGrant);

            if (grantId > 0)
            {
                mgr.SaveGrantPI(grantId, TextBoxPI.Text.Split(';'), Creator, DateTime.Now);

                List <GrantBiostat> lstBiostat = GetGrantBiostat(grantId);
                mgr.SaveGrantBiostat(grantId, lstBiostat);
            }

            //LoadEditScript(false);
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(),
                                                    "ModalScript", PageUtility.LoadEditScript(false), false);

            //if (Request.QueryString.Count > 0)
            //{
            //    //Request.QueryString.Remove("ProjectId");
            //    //Response.Redirect("GrantForm");
            //    string newUrl = Request.Url.AbsolutePath;
            //    Response.Write(newUrl);
            //}

            BindGridViewGrantAll();
        }
Example #7
0
        internal int SaveGrant(int grantId, Grant newGrant)
        {
            int gid = 0;

            using (ProjectTrackerContainer db = new ProjectTrackerContainer())
            {
                if (grantId > 0) //update
                {
                    var orgGrant = db.Grants.FirstOrDefault(g => g.Id == grantId);

                    if (orgGrant != null)
                    {
                        db.Entry(orgGrant).CurrentValues.SetValues(newGrant);
                    }
                }
                else //new
                {
                    db.Grants.Add(newGrant);
                }

                db.SaveChanges();
                gid = newGrant.Id;
            }

            return(gid);
        }
Example #8
0
        public async Task <ActionResult <Grant> > PostGrant(Grant grant)
        {
            _context.Grant.Add(grant);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetGrant", new { id = grant.Id }, grant));
        }
Example #9
0
        public async Task <IActionResult> PutGrant([FromRoute] int id, [FromBody] Grant grant)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != grant.Id)
            {
                return(BadRequest());
            }

            _context.Entry(grant).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!GrantExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Example #10
0
        //get list of Groups/Users
        private List <Grant> GetListOfTables(string sql_query)
        {
            var listOfObjects = new List <Grant>();

            using (var conn = new NpgsqlConnection(_connectionString))
            {
                conn.Open();
                using (var command = new NpgsqlCommand(sql_query, conn))
                {
                    using (var dataReader = command.ExecuteReader())
                    {
                        while (dataReader.Read())
                        {
                            var objectpsql = new Grant();

                            objectpsql.Table_schema  = dataReader["table_schema"].ToString();
                            objectpsql.Table_name    = dataReader["table_name"].ToString();
                            objectpsql.Descript      = dataReader["descript"].ToString();
                            objectpsql.IsSelect      = Convert.ToBoolean(dataReader["isselect"]);
                            objectpsql.IsUpdate      = Convert.ToBoolean(dataReader["isupdate"]);
                            objectpsql.IsInsert      = Convert.ToBoolean(dataReader["isinsert"]);
                            objectpsql.IsDelete      = Convert.ToBoolean(dataReader["isdelete"]);
                            objectpsql.ColumnsSelect = dataReader["columns_select"].ToString();
                            objectpsql.ColumnsUpdate = dataReader["columns_update"].ToString();
                            objectpsql.ColumnsInsert = dataReader["columns_insert"].ToString();

                            listOfObjects.Add(objectpsql);
                        }
                    }
                }
            }
            return(listOfObjects);
        }
Example #11
0
        /// <summary>
        /// Inserts a Grant
        /// </summary>
        /// <param name="grant"></param>
        /// <returns></returns>
        public int InsertGrant(Grant grant)
        {
            int grantID = 0;
            var conn    = DBConnection.GetConnection();
            var cmd     = new SqlCommand("sp_insert_grant", conn);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@GrantName", grant.GrantName);
            cmd.Parameters.AddWithValue("@Description", grant.Description);
            cmd.Parameters.AddWithValue("@AmountAskedFor", grant.AmountAskedFor);
            try
            {
                conn.Open();
                grantID = Convert.ToInt32(cmd.ExecuteScalar());
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }

            return(grantID);
        }
Example #12
0
        /// <summary>
        /// selects a grant by id
        /// </summary>
        /// <param name="grantID"></param>
        /// <returns></returns>
        public Grant SelectGrantByGrantID(int grantID)
        {
            Grant grant = new Grant();
            var   conn  = DBConnection.GetConnection();
            var   cmd   = new SqlCommand("sp_select_grant_by_id", conn);

            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.AddWithValue("@GrantID", grantID);

            try
            {
                conn.Open();
                var reader = cmd.ExecuteReader();
                if (reader.Read())
                {
                    grant.GrantID        = reader.GetInt32(0);
                    grant.GrantName      = reader.GetString(1);
                    grant.Points         = reader.GetInt32(2);
                    grant.Description    = reader.IsDBNull(3) ?null : reader.GetString(3);
                    grant.AmountAskedFor = reader.GetDecimal(4);
                    grant.AmountRecieved = reader.GetDecimal(5);
                    grant.Active         = reader.GetBoolean(6);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                conn.Close();
            }
            return(grant);
        }
Example #13
0
 public ClaimValueMatchesParameterValueAssertion(string claimType, string parameterName, Grant grant)
 {
     _claimType     = claimType;
     _parameterName = parameterName;
     Grant          = grant;
     Information    = new AssertionInformation("match", $"{_claimType} : {_parameterName}", Grant);
 }
Example #14
0
        public ActionResult Duplicate(GrantPrimaryKey grantPrimaryKey, DuplicateGrantViewModel viewModel)
        {
            var originalGrant = grantPrimaryKey.EntityObject;

            Check.EnsureNotNull(originalGrant);

            var initialAwardGrantModificationForCopy = HttpRequestStorage.DatabaseEntities.GrantModifications.Single(gm => gm.GrantModificationID == viewModel.InitialAwardGrantModificationID);

            if (!ModelState.IsValid)
            {
                return(DuplicateGrantViewEdit(viewModel, originalGrant, initialAwardGrantModificationForCopy.GrantAllocations.ToList()));
            }

            var grantStatus  = HttpRequestStorage.DatabaseEntities.GrantStatuses.Single(gs => gs.GrantStatusID == viewModel.GrantStatusID);
            var organization = originalGrant.Organization;
            var newGrant     = Grant.CreateNewBlank(grantStatus, organization);

            viewModel.UpdateModel(newGrant);
            newGrant.CFDANumber  = originalGrant.CFDANumber;
            newGrant.GrantTypeID = originalGrant.GrantTypeID;

            var newGrantModification = GrantModification.CreateNewBlank(newGrant, initialAwardGrantModificationForCopy.GrantModificationStatus);

            newGrantModification.GrantModificationAmount    = viewModel.GrantModificationAmount ?? 0;
            newGrantModification.GrantModificationStartDate = viewModel.GrantStartDate ?? DateTime.Today;
            newGrantModification.GrantModificationEndDate   = viewModel.GrantEndDate ?? DateTime.Today;
            newGrantModification.GrantModificationName      = GrantModificationPurpose.InitialAward.GrantModificationPurposeName;
            var newGrantModificationPurpose = GrantModificationGrantModificationPurpose.CreateNewBlank(newGrantModification, GrantModificationPurpose.InitialAward);

            if (viewModel.GrantAllocationsToDuplicate != null && viewModel.GrantAllocationsToDuplicate.Any())
            {
                foreach (var allocationID in viewModel.GrantAllocationsToDuplicate)
                {
                    var allocationToCopy =
                        HttpRequestStorage.DatabaseEntities.GrantAllocations.Single(ga =>
                                                                                    ga.GrantAllocationID == allocationID);
                    var newAllocation = GrantAllocation.CreateNewBlank(newGrantModification);
                    newAllocation.GrantAllocationName = allocationToCopy.GrantAllocationName;
                    newAllocation.StartDate           = allocationToCopy.StartDate;
                    newAllocation.EndDate             = allocationToCopy.EndDate;

                    // 10/7/20 TK - not sure we wanna copy these but going for it anyways
                    newAllocation.FederalFundCodeID = allocationToCopy.FederalFundCodeID;
                    newAllocation.OrganizationID    = allocationToCopy.OrganizationID;
                    newAllocation.DNRUplandRegionID = allocationToCopy.DNRUplandRegionID;
                    newAllocation.DivisionID        = allocationToCopy.DivisionID;
                    newAllocation.GrantManagerID    = allocationToCopy.GrantManagerID;

                    // 10/7/20 TK - make sure we setup the budgetLineItems for the new allocation
                    newAllocation.CreateAllGrantAllocationBudgetLineItemsByCostType();
                }
            }

            //need to save changes here, because otherwise the MessageForDisplay will link to an item with a negative ID, causing errors
            HttpRequestStorage.DatabaseEntities.SaveChanges();
            SetMessageForDisplay($"{FieldDefinition.Grant.GetFieldDefinitionLabel()} \"{UrlTemplate.MakeHrefString(newGrant.GetDetailUrl(), newGrant.GrantName)}\" has been created.");
            return(new ModalDialogFormJsonResult());
            //return RedirectToAction(new SitkaRoute<GrantController>(gc => gc.GrantDetail(newGrant.GrantID)));
        }
Example #15
0
        /// <summary>
        /// Sets the Grant Form with the instance of the grant provided (and presumably obtained from the database.)
        /// </summary>
        /// <param name="grant">Referred instance of a grant.</param>
        private void SetGrant(Grant grant)
        {
            if (grant != null)
            {
                lblGrantId.Text          = grant.Id > 0 ? grant.Id.ToString() : string.Empty;
                ddlProject.SelectedValue = grant.ProjectId.ToString();

                TextBoxCollab.Text        = grant.Collab;
                TextBoxHealthInit.Text    = grant.HealthInit;
                chkNativeHawaiian.Checked = grant.NativeHawaiian;
                TextBoxGrantTitle.Text    = grant.GrantTitle;
                TextBoxGrantType.Text     = grant.GrantType;
                TextBoxPgmAnn.Text        = grant.PgmAnn;
                TextBoxFundAgcy.Text      = grant.FundAgcy;
                TextBoxStartDate.Text     = grant.StartDate != null?Convert.ToDateTime(grant.StartDate).ToShortDateString() : "";

                TextBoxEndDate.Text = grant.EndDate != null?Convert.ToDateTime(grant.EndDate).ToShortDateString() : "";

                TextBoxFirstYrAmt.Text = string.Format("{0:n0}", grant.FirstYrAmt);
                TextBoxTotalAmt.Text   = string.Format("{0:n0}", grant.TotalAmt);
                TextBoxTotalCost.Text  = string.Format("{0:n0}", grant.TotalCost);

                TextBoxMyGrantNum.Text = grant.MyGrantNum.ToString();
                TextBoxFundNum.Text    = grant.Fundnum;

                ddlGrantStatus.ClearSelection();
                if (grant.GrantStatus != null)
                {
                    var grantStatus = ddlGrantStatus.Items.FindByText(grant.GrantStatus);
                    if (grantStatus != null)
                    {
                        grantStatus.Selected = true;
                    }
                }

                ddlFundStatus.ClearSelection();
                if (grant.FundStatus != null)
                {
                    var fundStatus = ddlFundStatus.Items.FindByText(grant.FundStatus);
                    if (fundStatus != null)
                    {
                        fundStatus.Selected = true;
                    }
                }

                TextBoxSubDate.Text = grant.SubDate != null?Convert.ToDateTime(grant.SubDate).ToShortDateString() : "";

                TextBoxSubDeadline.Text = grant.SubDeadline != null?Convert.ToDateTime(grant.SubDeadline).ToShortDateString() : "";

                TextBoxInitDate.Text = grant.InitDate != null?Convert.ToDateTime(grant.InitDate).ToShortDateString() : "";

                TextBoxFundDate.Text = grant.FundDate != null?Convert.ToDateTime(grant.FundDate).ToShortDateString() : "";

                TextBoxFollowup.Text = grant.Followup;
                TextBoxComment.Text  = grant.Comment;

                chkInternal.Checked = grant.IsInternal;
            }
        }
Example #16
0
        public ActionResult DeleteConfirmed(Guid id)
        {
            Grant grant = dbGrants.Grants.Find(id);

            dbGrants.Grants.Remove(grant);
            dbGrants.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #17
0
 public void Add(AssertionMatch match)
 {
     if (match.Assertion.Grant > Grant)
     {
         Grant = match.Assertion.Grant;
     }
     _matches.Add(match);
 }
Example #18
0
            public static Grant Create(Organization organization, string grantName)
            {
                var grantStatus   = GetDefaultGrantStatus();
                var testGrantName = GetTestGrantName(organization, grantName);
                var grant         = new Grant(testGrantName, grantStatus, organization);

                return(grant);
            }
Example #19
0
        private void BindEditModal(Grant grant)
        {
            SetGrant(grant);

            SetGrantPI(grant.GrantPIs);

            BindGridViewBiostat(grant.GrantBiostats);
        }
Example #20
0
            public static Grant Create()
            {
                var grantStatus  = GetDefaultGrantStatus();
                var organization = TestFramework.TestOrganization.Create();
                var grant        = new Grant(TestFramework.MakeTestName("Grant", Grant.FieldLengths.GrantName), grantStatus, organization);

                //Grant.IsActive = true;
                return(grant);
            }
        public override GetBucketLoggingResponse ParseGetBucketLoggingResponse(HttpResponse httpResponse)
        {
            GetBucketLoggingResponse response = new GetBucketLoggingResponse();

            using (XmlReader xmlReader = XmlReader.Create(httpResponse.Content))
            {
                Grant currentGrant = null;
                while (xmlReader.Read())
                {
                    if ("BucketLoggingStatus".Equals(xmlReader.Name))
                    {
                        if (xmlReader.IsStartElement())
                        {
                            response.Configuration = new LoggingConfiguration();
                        }
                    }
                    else if ("Agency".Equals(xmlReader.Name))
                    {
                        response.Configuration.Agency = xmlReader.ReadString();
                    }
                    else if ("TargetBucket".Equals(xmlReader.Name))
                    {
                        response.Configuration.TargetBucketName = xmlReader.ReadString();
                    }
                    else if ("TargetPrefix".Equals(xmlReader.Name))
                    {
                        response.Configuration.TargetPrefix = xmlReader.ReadString();
                    }
                    else if ("Grant".Equals(xmlReader.Name))
                    {
                        if (xmlReader.IsStartElement())
                        {
                            currentGrant = new Grant();
                            response.Configuration.Grants.Add(currentGrant);
                        }
                    }
                    else if ("ID".Equals(xmlReader.Name))
                    {
                        CanonicalGrantee grantee = new CanonicalGrantee();
                        grantee.Id           = xmlReader.ReadString();
                        currentGrant.Grantee = grantee;
                    }
                    else if ("Canned".Equals(xmlReader.Name))
                    {
                        GroupGrantee grantee = new GroupGrantee();
                        grantee.GroupGranteeType = this.ParseGroupGrantee(xmlReader.ReadString());
                        currentGrant.Grantee     = grantee;
                    }
                    else if ("Permission".Equals(xmlReader.Name))
                    {
                        currentGrant.Permission = this.ParsePermission(xmlReader.ReadString());
                    }
                }
            }
            return(response);
        }
Example #22
0
 public async Task SaveAsync(Grant obj)
 {
     using (var connection = new SqlConnection(ConnectionString))
     {
         var results = await connection.ExecuteAsync(
             "[dbo].[Grant_Save]",
             obj,
             commandType : CommandType.StoredProcedure);
     }
 }
Example #23
0
            public static Grant Create(DatabaseEntities dbContext)
            {
                var    organization    = TestFramework.TestOrganization.Insert(dbContext);
                string testGrantName   = TestFramework.MakeTestName("Test Grant Name");
                var    testGrantStatus = GetDefaultGrantStatus();
                var    grant           = new Grant(testGrantName, testGrantStatus, organization);

                dbContext.Grants.Add(grant);
                return(grant);
            }
Example #24
0
        /// <summary>
        /// Loads Grant form with originally/previously entered
        /// grant information.
        /// </summary>
        /// <param name="grantId">Referred grant</param>
        private void LoadEditGrant(int grantId)
        {
            Grant grant = mgr.GetGrantById(grantId);

            if (grant != null)
            {
                //MyGrant = grant;
                BindEditModal(grant);
            }
        }
Example #25
0
 public ActionResult Edit([Bind(Include = "Grant_ID,Grantor_ID,Grant_Name,Grant_Due_Date,Grant_Amount,Grant_Type,Grant_status,Author")] Grant grant)
 {
     if (ModelState.IsValid)
     {
         db.Entry(grant).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Grantor_ID = new SelectList(db.Grantors, "Grantor_ID", "Organization", grant.Grantor_ID);
     return(View(grant));
 }
Example #26
0
        private static string ConvertGrant(Grant grant)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("<Grant>");
            builder.Append(ConvertGrantee(grant.Grantee));
            builder.Append(ConvertPermission(grant.Permission));
            builder.Append("</Grant>");

            return(builder.ToString());
        }
Example #27
0
        private static String convertGrant(Grant grant)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("<Grant>");
            builder.Append(convertGrantee(grant.getGrantee()));
            builder.Append(convertPermission(grant.getPermission()));
            builder.Append("</Grant>");

            return(builder.ToString());
        }
Example #28
0
        /// <summary>
        /// Populates Grant form from information obtained from
        /// grant instance.
        /// </summary>
        /// <param name="grant">Referred grant.</param>
        private void BindEditModal(Grant grant)
        {
            // Sets grant form with grant information provided.
            SetGrant(grant);

            // Sets Principal Investigator text box for grant form.
            SetGrantPI(grant.GrantPIs);

            // Populates Biostatistician section of grant form.
            BindGridViewBiostat(grant.GrantBiostats);
        }
Example #29
0
        public void GrantOn(DbObjectType objectType, ObjectName objectName, string grantee, Privileges privileges, bool withOption = false)
        {
            try {
                var granter = Session.User.Name;

                var grant = new Grant(privileges, objectName, objectType, grantee, granter, withOption);
                PrivilegeManager.Grant(grant);
            } finally {
                PrivilegesCache.Remove(new GrantCacheKey(grantee, objectType, objectName.FullName, withOption, false));
            }
        }
Example #30
0
 public void Revoke(DbObjectType objectType, ObjectName objectName, string grantee, Privileges privileges,
                    bool grantOption = false)
 {
     try {
         var revoker = Session.User.Name;
         var grant   = new Grant(privileges, objectName, objectType, grantee, revoker, grantOption);
         SystemSession.Access().PrivilegeManager.Revoke(grant);
     } finally {
         var key = new GrantCacheKey(grantee, objectType, objectName.FullName, grantOption, false);
         PrivilegesCache.Remove(key);
     }
 }
Example #31
0
 /// <remarks/>
 public System.IAsyncResult BeginCreateBucket(string Bucket, Grant[] AccessControlList, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("CreateBucket", new object[] {
                 Bucket,
                 AccessControlList,
                 AWSAccessKeyId,
                 Timestamp,
                 TimestampSpecified,
                 Signature}, callback, asyncState);
 }
Example #32
0
 /// <remarks/>
 public void CreateBucketAsync(string Bucket, Grant[] AccessControlList, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature) {
     this.CreateBucketAsync(Bucket, AccessControlList, AWSAccessKeyId, Timestamp, TimestampSpecified, Signature, null);
 }
Example #33
0
 /// <remarks/>
 public System.IAsyncResult BeginSetBucketAccessControlPolicy(string Bucket, Grant[] AccessControlList, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature, string Credential, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("SetBucketAccessControlPolicy", new object[] {
                 Bucket,
                 AccessControlList,
                 AWSAccessKeyId,
                 Timestamp,
                 TimestampSpecified,
                 Signature,
                 Credential}, callback, asyncState);
 }
Example #34
0
 /// <remarks/>
 public void SetBucketAccessControlPolicyAsync(string Bucket, Grant[] AccessControlList, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature, string Credential) {
     this.SetBucketAccessControlPolicyAsync(Bucket, AccessControlList, AWSAccessKeyId, Timestamp, TimestampSpecified, Signature, Credential, null);
 }
Example #35
0
 /// <remarks/>
 public void SetBucketAccessControlPolicyAsync(string Bucket, Grant[] AccessControlList, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature, string Credential, object userState) {
     if ((this.SetBucketAccessControlPolicyOperationCompleted == null)) {
         this.SetBucketAccessControlPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetBucketAccessControlPolicyOperationCompleted);
     }
     this.InvokeAsync("SetBucketAccessControlPolicy", new object[] {
                 Bucket,
                 AccessControlList,
                 AWSAccessKeyId,
                 Timestamp,
                 TimestampSpecified,
                 Signature,
                 Credential}, this.SetBucketAccessControlPolicyOperationCompleted, userState);
 }
Example #36
0
 /// <remarks/>
 public System.IAsyncResult BeginPutObjectInline(string Bucket, string Key, MetadataEntry[] Metadata, byte[] Data, long ContentLength, Grant[] AccessControlList, StorageClass StorageClass, bool StorageClassSpecified, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature, string Credential, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("PutObjectInline", new object[] {
                 Bucket,
                 Key,
                 Metadata,
                 Data,
                 ContentLength,
                 AccessControlList,
                 StorageClass,
                 StorageClassSpecified,
                 AWSAccessKeyId,
                 Timestamp,
                 TimestampSpecified,
                 Signature,
                 Credential}, callback, asyncState);
 }
Example #37
0
        private void readAcl( Acl acl, string header, EsuApiLib.Grantee.GRANTEE_TYPE type )
        {
            log.TraceEvent(TraceEventType.Verbose, 0,  "readAcl: " + header );
            string[] grants = header.Split( new string[] { "," }, StringSplitOptions.RemoveEmptyEntries );
            for( int i = 0; i < grants.Length; i++ ) {
                string[] nvpair = grants[i].Split( new string[] { "=" }, 2, StringSplitOptions.RemoveEmptyEntries );
                string grantee = nvpair[0];
                string permission = nvpair[1];

                grantee = grantee.Trim();

                // Currently, the server returns "FULL" instead of "FULL_CONTROL".
                // For consistency, change this to value use in the request
                if( "FULL".Equals( permission ) ) {
                    permission = Permission.FULL_CONTROL;
                }

                log.TraceEvent(TraceEventType.Verbose, 0,  "grant: " + grantee + "." + permission + " (" + type
                        + ")" );

                Grantee ge = new Grantee( grantee, type );
                Grant gr = new Grant( ge, permission );
                log.TraceEvent(TraceEventType.Verbose, 0,  "Grant: " + gr );
                acl.AddGrant( gr );
            }
        }
Example #38
0
 /// <remarks/>
 public void PutObjectInlineAsync(string Bucket, string Key, MetadataEntry[] Metadata, byte[] Data, long ContentLength, Grant[] AccessControlList, StorageClass StorageClass, bool StorageClassSpecified, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature, string Credential) {
     this.PutObjectInlineAsync(Bucket, Key, Metadata, Data, ContentLength, AccessControlList, StorageClass, StorageClassSpecified, AWSAccessKeyId, Timestamp, TimestampSpecified, Signature, Credential, null);
 }
Example #39
0
 /// <remarks/>
 public void PutObjectInlineAsync(string Bucket, string Key, MetadataEntry[] Metadata, byte[] Data, long ContentLength, Grant[] AccessControlList, StorageClass StorageClass, bool StorageClassSpecified, string AWSAccessKeyId, System.DateTime Timestamp, bool TimestampSpecified, string Signature, string Credential, object userState) {
     if ((this.PutObjectInlineOperationCompleted == null)) {
         this.PutObjectInlineOperationCompleted = new System.Threading.SendOrPostCallback(this.OnPutObjectInlineOperationCompleted);
     }
     this.InvokeAsync("PutObjectInline", new object[] {
                 Bucket,
                 Key,
                 Metadata,
                 Data,
                 ContentLength,
                 AccessControlList,
                 StorageClass,
                 StorageClassSpecified,
                 AWSAccessKeyId,
                 Timestamp,
                 TimestampSpecified,
                 Signature,
                 Credential}, this.PutObjectInlineOperationCompleted, userState);
 }