Exemple #1
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            List <PermissionDetail> permissionDetails = new List <PermissionDetail>();

            foreach (var perMaster in Permissions.Where(x => x.IsPermitted))
            {
                PermissionDetail permissionDetail = new PermissionDetail
                {
                    CreatedBy    = StaticData.CurrentUserId,
                    CreatedDate  = DateTime.Now,
                    PermissionId = perMaster.Id,
                    UserId       = UserId
                };
                permissionDetails.Add(permissionDetail);
            }

            Operation <string> operation = OperationHandler.PostUserPermissions(UserId, permissionDetails);

            if (operation.Successful)
            {
                this.Close();
            }
            lblError.Text = operation.Fail;
        }