protected void DeluxeGridDelegationList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "DeleteDelegation")
            {
                var lnkBtn = e.CommandSource as LinkButton;
                if (lnkBtn != null)
                {
                    string sid = lnkBtn.Attributes["data-sid"];
                    string tid = lnkBtn.Attributes["data-tid"];

                    WfDelegationCollection wfDelegation = WfDelegationAdapter.Instance.Load(builder =>
                    {
                        builder.AppendItem("SOURCE_USER_ID", sid);
                        builder.AppendItem("DESTINATION_USER_ID", tid);
                    });

                    if (wfDelegation.Count == 1)
                    {
                        WfDelegationAdapter.Instance.Delete(wfDelegation[0]);

                        LogUtil.AppendLogToDb(LogUtil.CreateDissassignLog(wfDelegation[0]));
                    }
                    else
                    {
                        throw new ApplicationException("不存在指定条件的委托");
                    }

                    this.InnerRefreshList();
                }
            }
        }
Example #2
0
 protected void DefaultProcessRequest(string delegateUserID)
 {
     if (string.IsNullOrEmpty(delegateUserID))
     {
         DefaultProcessRequest();
     }
     else
     {
         WfDelegationCollection delegation   = WfDelegationAdapter.Instance.Load(builder => builder.AppendItem("DESTINATION_USER_ID", delegateUserID));
         WfDelegation           wfDelegation = new WfDelegation();
         foreach (WfDelegation delegation1 in delegation)
         {
             wfDelegation.DestinationUserID   = delegation1.DestinationUserID;
             wfDelegation.DestinationUserName = delegation1.DestinationUserName;
             wfDelegation.StartTime           = delegation1.StartTime;
             wfDelegation.EndTime             = delegation1.EndTime;
             wfDelegation.SourceUserID        = delegation1.SourceUserID;
             wfDelegation.SourceUserName      = delegation1.SourceUserName;
         }
         if (delegation.Count > 0)
         {
             Data = wfDelegation;
             IOguObject oguObject =
                 OguMechanismFactory.GetMechanism().GetObjects <IOguObject>(SearchOUIDType.Guid, Data.DestinationUserID)[
                     0];
             DelegatedUserInput.SelectedOuUserData.Add(oguObject);
         }
     }
 }
        public List <WfClientDelegation> LoadUserDelegations(string userID)
        {
            OperationContext.Current.FillContextToOguServiceContext();

            WfDelegationCollection delegations = WfDelegationAdapter.Instance.Load(userID);

            return(WfClientDelegationConverter.Instance.ServerToClient(delegations));
        }
Example #4
0
        /// <summary>
        /// 个人信息
        /// </summary>
        private void RenderPersonalInfo()
        {
            lblUserName.Text = Server.HtmlEncode("您好!" + DeluxeIdentity.CurrentUser.DisplayName);
            WfDelegationCollection delegationCollection = WfDelegationAdapter.Instance.GetUserActiveDelegations(DeluxeIdentity.CurrentUser.ID);

            if (delegationCollection.Count > 0)
            {
                lblUserName.Style["color"]   = "#ddd";
                imgDelegate.Style["display"] = "";
            }
        }
        public List <WfClientDelegation> ServerToClient(WfDelegationCollection server)
        {
            List <WfClientDelegation> client = new List <WfClientDelegation>();

            foreach (WfDelegation opinion in server)
            {
                WfClientDelegation clientOpinion = null;

                ServerToClient(opinion, ref clientOpinion);

                client.Add(clientOpinion);
            }

            return(client);
        }
        public List<WfClientDelegation> ServerToClient(WfDelegationCollection server)
        {
            List<WfClientDelegation> client = new List<WfClientDelegation>();

            foreach (WfDelegation opinion in server)
            {
                WfClientDelegation clientOpinion = null;

                ServerToClient(opinion, ref clientOpinion);

                client.Add(clientOpinion);
            }

            return client;
        }
Example #7
0
        protected void DeluxeGridDelegationList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "DeleteDelegation")
            {
                WfDelegationCollection wfDelegation = WfDelegationAdapter.Instance.Load(builder =>
                {
                    builder.AppendItem("DESTINATION_USER_ID", e.CommandArgument.ToString());
                    builder.AppendItem("SOURCE_USER_ID", DeluxeIdentity.CurrentUser.ID);
                });


                WfDelegationAdapter.Instance.Delete(wfDelegation[0]);

                LogUtil.AppendLogToDb(LogUtil.CreateDissassignLog(wfDelegation[0]));
            }
        }