当前位置: 首页>>代码示例>>C#>>正文


C# NameCollection类代码示例

本文整理汇总了C#中NameCollection的典型用法代码示例。如果您正苦于以下问题:C# NameCollection类的具体用法?C# NameCollection怎么用?C# NameCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


NameCollection类属于命名空间,在下文中一共展示了NameCollection类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: StartWorkflowButton_Executing

        private void StartWorkflowButton_Executing(object sender, CancelEventArgs e)
        {
            var btn = sender as StartWorkflowButton;
            var dpTaskUsers = new NameCollection();
            var isSave = string.Equals(btn.Text, "Save", StringComparison.CurrentCultureIgnoreCase);
            if (isSave == false)
            {
                if (!this.DataForm1.Validate()){
                    DisplayMessage(this.DataForm1.msg.IsNotNullOrWhitespace() ?
                                   this.DataForm1.msg : "Please fill in all the necessary fields.");
                    e.Cancel = true;
                    return;
                }

                //获取审批人
                dpTaskUsers = GetNextApproveTaskUsers();
                if (dpTaskUsers == null){
                    DisplayMessage("The manager is not set in the system.");
                    e.Cancel = true;
                    return;
                }
            }

            //更新工作流变量
            UpdateWorkflowVariable(dpTaskUsers, isSave);
            //更新list相关变量
            UpdateWorkFlowDataFields(dpTaskUsers, isSave);

            WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:30,代码来源:NewForm.aspx.cs

示例2: Actions_ActionExecuting

        private void Actions_ActionExecuting(object sender, CancelEventArgs e)
        {
            if (!this.DataForm1.Validate())
            {
                DisplayMessage(this.DataForm1.msg.IsNotNullOrWhitespace() ? this.DataForm1.msg : "Please fill in all the necessary fields.");
                e.Cancel = true;
                return;
            }

            //审批人
            var dpTaskUsers = new NameCollection();
            dpTaskUsers = GetNextApproveTaskUsers();
            if (dpTaskUsers == null)
            {
                DisplayMessage("The manager is not set in the system.");
                e.Cancel = true;
                return;
            }

            //更新工作流变量
            UpdateWorkflowVariable(dpTaskUsers, false);
            //更新list相关变量
            UpdateWorkFlowDataFields(dpTaskUsers, false);

            WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:26,代码来源:EditForm.aspx.cs

示例3: GetNextApproveTaskUsers

        /// <summary>
        /// 获取下一步审批人
        /// </summary>
        /// <returns></returns>
        private NameCollection GetNextApproveTaskUsers()
        {
            var nextApproveTaskUsers = new NameCollection();
            var manager = UserProfileUtil.GetDepartmentManager(CurrentEmployee.Department);
            if (manager.IsNullOrWhitespace()){
                return null;
            }
            else if (manager.Equals(CurrentEmployee.UserAccount, StringComparison.CurrentCultureIgnoreCase))
            {
                var managerEmp = WorkFlowUtil.GetEmployeeApprover(CurrentEmployee);
                if (managerEmp == null)
                {
                    return null;
                }
                manager = managerEmp.UserAccount;
            }

            nextApproveTaskUsers.Add(manager);
            //获取代理人员
            var deleman = WorkFlowUtil.GetDeleman(manager, CA.WorkFlow.UI.Constants.CAModules.InternalOrderCreation);
            if (deleman != null)
            {
                nextApproveTaskUsers.Add(deleman);
            }

            return nextApproveTaskUsers;
        }
开发者ID:porter1130,项目名称:C-A,代码行数:31,代码来源:EditForm.aspx.cs

示例4: GetTaskUsers

 //得到组里的用户
 public static NameCollection GetTaskUsers(string group)
 {
     NameCollection taskUsers = new NameCollection();
     List<string> groupUsers = null;
     groupUsers = WorkFlowUtil.UserListInGroup(group);
     taskUsers.AddRange(groupUsers.ToArray());
     return taskUsers;
 }
开发者ID:porter1130,项目名称:C-A,代码行数:9,代码来源:AcceleratorComm.cs

示例5: CheckNextApprove

        /// <summary>
        /// 检查下一步审批
        /// </summary>
        /// <param name="cfoTaskUsers">CFO</param>
        /// <param name="faTaskUsers">财务</param>
        /// <param name="e">事件对象</param>
        /// <param name="manager">管理者</param>
        /// <param name="status">状态</param>
        /// <param name="orderNum"></param>
        /// <param name="isReject">是否拒绝</param>
        /// <param name="isToCfo">是否转向CFO审批</param>
        private void CheckNextApprove(int paymentTerm, ref NameCollection cfoTaskUsers, ref NameCollection faTaskUsers, ActionEventArgs e, string manager, ref string status, ref string vendorID, ref bool isReject, ref bool isToCfo)
        {
            if (WorkflowContext.Current.Step == "DepartmentManagerTask")
            {
                faTaskUsers = GetTaskUsers("wf_Finance_MDM");
                cfoTaskUsers = GetTaskUsers("wf_CFO");

                if (e.Action == "Approve")
                {
                    isToCfo = (paymentTerm >= 30) ? false : true;
                    status = CAWorkflowStatus.IODepartmentManagerApprove;
                }
                else if (e.Action == "Reject")
                {
                    isReject = true;
                    status = CAWorkflowStatus.IODepartmentManagerReject;
                }
                AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
            }
            else if (WorkflowContext.Current.Step == "CfoTask")
            {
                if (e.Action == "Approve")
                {
                    faTaskUsers = GetTaskUsers("wf_Finance_MDM");
                    status = CAWorkflowStatus.IOCFOApprove;
                }
                else if (e.Action == "Reject")
                {
                    isReject = true;
                    status = CAWorkflowStatus.IOCFOReject;
                }
                AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
            }
            else if (WorkflowContext.Current.Step == "MdmTask")
            {
                //不论财务是拒绝还是确认,工作流都结束
                if (e.Action == "Confirm")
                {
                    status = CAWorkflowStatus.Completed;
                }
                else if (e.Action == "Reject")
                {
                    vendorID = string.Empty;
                    status = CAWorkflowStatus.IOFinanceReject;
                }
                AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
            }

            bool isCfo = CurrentManagerIsCfo(cfoTaskUsers, manager);
            //如果部门领导是CFO,当点击 “To CFO”,直接跳转到财务
            if (isCfo && isToCfo)
            {
                isToCfo = false;
                status = CAWorkflowStatus.IOCFOApprove;
                AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApprovers, CA.WorkFlow.UI.Constants.WorkFlowStep.SupplierSetupMaintenanceApproverLoginName);
            }
        }
开发者ID:porter1130,项目名称:C-A,代码行数:68,代码来源:ApproveForm.aspx.cs

示例6: ConvertToList

 public static List<string> ConvertToList(NameCollection coll)
 {
     List<string> list = new List<string>();
     foreach (var temp in coll)
     {
         list.Add(temp);
     }
     return list;
 }
开发者ID:porter1130,项目名称:C-A,代码行数:9,代码来源:PaymentRequestComm.cs

示例7: Actions_ActionExecuting

        void Actions_ActionExecuting(object sender, QuickFlow.UI.Controls.ActionEventArgs e)
        {
            if (e.Action.Equals("Approve"))//审批通过
            {
                WorkflowDataFields fields = WorkflowContext.Current.DataFields;
                decimal TotalCost = GetTotalCost();
                if (TotalCost == 0)
                {
                    DisplayMessage("Rate or Cost error!");
                    e.Cancel = true;
                    return;
                }

                string levelType = "Contract Approval Limits";
                string sCurrentManager = CurrentEmployee.UserAccount;
                var quota = WorkFlowUtil.GetQuota(CurrentEmployee.UserAccount, levelType);///得到当前审批人的审批金额

                WorkflowContext context = WorkflowContext.Current;
                if (TotalCost > quota)///当前审批者不够审批此金额。
                {
                    context.UpdateWorkflowVariable("IsApproveAgin", true);//

                    NameCollection manager = new NameCollection();
                    Employee managerEmp = WorkFlowUtil.GetNextApprover(sCurrentManager);
                    if (managerEmp == null && !WorkflowPerson.IsCEO(sCurrentManager))
                    {
                        DisplayMessage("The manager is not set in the system.");
                        e.Cancel = true;
                        return;
                    }
                    manager.Add(managerEmp.UserAccount);

                    string sDelePerson = WorkFlowUtil.GetDeleman(managerEmp.UserAccount, WorkFlowUtil.GetModuleIdByListName("PurchaseRequestGeneral")); //查找代理人
                    if (sDelePerson != null)
                    {
                        manager.Add(sDelePerson);
                    }
                    context.UpdateWorkflowVariable("ApproveUsers", manager);
                }
                else//进入到财务审批
                {
                    context.UpdateWorkflowVariable("IsApproveAgin", false);//
                }

                fields["Approvers"] = ReturnAllApprovers(sCurrentManager);
                fields["ApproversSPUser"] = ReturnAllApproversSP("ApproversSPUser", sCurrentManager);
            }
            else
            {
                WorkflowContext context = WorkflowContext.Current;
                WorkflowDataFields fields = WorkflowContext.Current.DataFields;
                string sWorkflowNo = fields["Title"].ToString();
                context.UpdateWorkflowVariable("EditTitle", "Please resubmit Purchase Ruequest-General:" + sWorkflowNo);//
            }
            WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:56,代码来源:ApproveForm.aspx.cs

示例8: IsSameUser

 public static bool IsSameUser(NameCollection user1,NameCollection user2,NameCollection user3)
 {
     bool flag = false;
     if (user1.Count == 1 && user2.Count == 1 && user3.Count == 1)
     {
         if (user1[0].ToString() == user2[0].ToString() && user2[0].ToString() == user3[0].ToString())
         {
             flag = true;
         }
     }
     return flag;
 }
开发者ID:porter1130,项目名称:C-A,代码行数:12,代码来源:Common.cs

示例9: Actions_ActionExecuting

        private void Actions_ActionExecuting(object sender, ActionEventArgs e)
        {
            string currentStatus = string.Empty;
            string manager = WorkflowContext.Current.DataFields["Manager"].AsString();
            string orderNum = WorkflowContext.Current.DataFields["Order Number"].AsString();
            bool isReject = false, isToCfo = false;

            NameCollection cfoTaskUsers = new NameCollection();
            NameCollection faTaskUsers = new NameCollection();
            CheckNextApprove(ref cfoTaskUsers, ref faTaskUsers, e, manager, ref currentStatus, ref orderNum,
                             ref isReject, ref isToCfo);
            UpdateWorkflowVariable(cfoTaskUsers, faTaskUsers, isReject, isToCfo);
            UpdateWorkFlowDataFields((isToCfo && cfoTaskUsers.Count > 0) ? cfoTaskUsers[0] : manager, currentStatus, orderNum);
            SendMailAndSaveApprovers(e, isReject);

            WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:17,代码来源:ApproveForm.aspx.cs

示例10: StartWorkflowButton_Executing

        private void StartWorkflowButton_Executing(object sender, CancelEventArgs e)
        {
            WorkflowContext context = WorkflowContext.Current;
            WorkflowDataFields fields = context.DataFields;

            context.UpdateWorkflowVariable("UploadBillTaskTitle", "Please upload credit card e-statement");
            context.UpdateWorkflowVariable("UploadBillTaskFormURL","/_Layouts/CA/WorkFlows/CreditCardClaim/UploadExcelBill.aspx");

             var taskUsers = new NameCollection();
            List<string> groupUsers = null;

            groupUsers = WorkFlowUtil.UserListInGroup(WorkflowGroupName.WF_FinanceConfirm);
            taskUsers.AddRange(groupUsers.ToArray());

            ReturnAllApproversSP("TaskUsers", groupUsers.ToArray());

            context.UpdateWorkflowVariable("UploadBillTaskUsers", taskUsers);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:18,代码来源:UploadExcelBill.aspx.cs

示例11: Actions_ActionExecuting

        void Actions_ActionExecuting(object sender, QuickFlow.UI.Controls.ActionEventArgs e)
        {
            WorkflowDataFields fields = WorkflowContext.Current.DataFields;
            if (!e.Action.Equals("Approve"))//审批拒绝
            {
                WorkflowContext context = WorkflowContext.Current;
                SendNoticeMail("Rejected");
                fields["Status"] = CAWorkflowStatus.Completed;
            }
            else if (WorkflowContext.Current.Step == "BD" || (WorkflowContext.Current.Step == "DMM"&&fields["IsSkipBD"].AsString() == "True"))
            {
                SendMMCNoticeMail();
            }
            else if (WorkflowContext.Current.Step == "MMCBBS")
            {
                WorkflowContext context = WorkflowContext.Current;
                NameCollection nc = new NameCollection();
                if (WorkFlowUtil.IsInGroup(CurrentEmployee.UserAccount, "wf_BSS"))
                {
                    // DeleteTask(fields["ID"].AsString(), "wf_BSS");
                    nc = GetApproverInGroup("wf_ACC");
                }
                else if (WorkFlowUtil.IsInGroup(CurrentEmployee.UserAccount, "wf_ACC"))
                {
                    //DeleteTask(fields["ID"].AsString(), "wf_MMC");
                    nc = GetApproverInGroup("wf_BSS");
                }
                context.UpdateWorkflowVariable("EndUsers", nc);
            }
            else if (WorkflowContext.Current.Step == "End")//是最后一步的最后一个人审批。
            {
                WorkflowContext context = WorkflowContext.Current;
                SendNoticeMail("Approved");
                fields["Status"] = CAWorkflowStatus.Completed;
            }

            string sCurrentManager = CurrentEmployee.UserAccount;
            fields["Approvers"] = ReturnAllApprovers(sCurrentManager);
            fields["ApproversSPUser"] = ReturnAllApproversSP("ApproversSPUser", sCurrentManager);
            WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:41,代码来源:ApproveForm.aspx.cs

示例12: actions_ActionExecuting

 void actions_ActionExecuting(object sender, QuickFlow.UI.Controls.ActionEventArgs e)
 {
     if (e.Action.Equals("End", StringComparison.CurrentCultureIgnoreCase))
     {
         WorkflowContext.Current.DataFields["Status"] = "Cancelled";
         return;
     }
     string msg = DataForm1.Validate();
     if (!string.IsNullOrEmpty(msg))
     {
         DisplayMessage(msg);
         e.Cancel = true;
         return;
     }
     NameCollection buyingUsers = new NameCollection();
     buyingUsers.Add(DataForm1.BuyingUser);
     WorkflowContext.Current.UpdateWorkflowVariable("BuyingApproveUsers", buyingUsers);
     WorkflowContext.Current.DataFields["BuyingUser"] = DataForm1.BuyingUser;
     WorkflowContext.Current.DataFields["FileName"] = DataForm1.Submit();
     WorkflowContext.Current.DataFields["Status"] = "In Progress";
 }
开发者ID:porter1130,项目名称:C-A,代码行数:21,代码来源:SavedForm.aspx.cs

示例13: actions_ActionExecuting

        void actions_ActionExecuting(object sender, QuickFlow.UI.Controls.ActionEventArgs e)
        {
            //SPFieldUserValueCollection col = WorkFlowUtil.GetApproversValue();
            //WorkflowContext.Current.DataFields["Approvers"] = col;
            //添加审批人
            AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, WorkFlowStep.SupplierReticketingApprovers, WorkFlowStep.SupplierReticketingApproverLoginName);
            switch (WorkflowContext.Current.Task.Step)
            {
                case WorkFlowStep.SupplierReticketingBuyingApprove:
                    WorkflowContext.Current.UpdateWorkflowVariable(WorkFlowStep.SupplierReticketingDepartmentHead, GetDelemanNameCollection(new NameCollection(WorkFlowUtil.GetUserInGroup("wf_BSSHead")), Constants.CAModules.SupplierReTicketingCharge));
                    break;
                case WorkFlowStep.SupplierReticketingDepartmentHeadApproval:
                    List<string> strGroupUser = WorkFlowUtil.UserListInGroup("wf_Finance_SR");
                    NameCollection GroupUsers = new NameCollection();
                    GroupUsers.AddRange(strGroupUser.ToArray());
                    WorkflowContext.Current.UpdateWorkflowVariable(WorkFlowStep.SupplierReticketingFinanceTaskUsers, GetDelemanNameCollection(GroupUsers, Constants.CAModules.SupplierReTicketingCharge));
                    break;
            }

            WorkFlowUtil.UpdateWorkflowPath(WorkflowContext.Current);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:21,代码来源:ApproveForm.aspx.cs

示例14: SendMailForSubmit

        private void SendMailForSubmit(NameCollection departmentManagerTaskUsers)
        {
            //Send mail to Onsite and Receptionist
            var templateTitle = "TravelRequest2Submit2";
            List<string> parameters = new List<string>();
            var applicantStr = WorkflowContext.Current.DataFields["Applicant"].AsString();
            var applicantName = WorkflowContext.Current.DataFields["EnglishName"].AsString();
            List<string> to = TravelRequest2Common.GetMailMembers("Receptionist", "C-Trip");
            string rootweburl = GetRootURL(System.Configuration.ConfigurationManager.AppSettings["rootweburl"]);
            string detailLink = rootweburl + "WorkFlowCenter/Lists/TravelRequestWorkflow2/TRPending.aspx";
            parameters.Add("");
            parameters.Add(applicantName);
            parameters.Add(workflowNumber);
            parameters.Add(detailLink);
            SendNotificationMail(templateTitle, parameters, to, false);

            //Send mail to Applicant
            to = new List<string>();
            parameters = new List<string>();
            var applicantAccount = WorkFlowUtil.GetApplicantAccount(applicantStr);
            var approverNames = WorkFlowUtil.GetDisplayNames(TravelRequest2Common.ConvertToList(departmentManagerTaskUsers));
            templateTitle = "TravelRequest2Submit1";
            //detailLink = rootweburl + "WorkFlowCenter/Lists/TravelRequestWorkflow2/MyApply.aspx";
            to.Add(applicantAccount);
            parameters.Add("");
            parameters.Add(approverNames);
            //parameters.Add(detailLink);
            SendNotificationMail(templateTitle, parameters, to, true);

            //Send mail to Department Manager
            parameters = new List<string>();
            to = TravelRequest2Common.ConvertToList(departmentManagerTaskUsers);
            templateTitle = "TravelRequest2Submit3";
            detailLink = rootweburl + "CA/MyTasks.aspx";
            parameters.Add("");
            parameters.Add(applicantName);
            parameters.Add(detailLink);
            SendNotificationMail(templateTitle, parameters, to, false);
        }
开发者ID:porter1130,项目名称:C-A,代码行数:39,代码来源:NewForm.aspx.cs

示例15: SetWorkflowBaseVariable

        /// <summary>
        /// 设置工作流变量
        /// </summary>
        /// <param name="bIsSubmit"></param>
        /// <param name="sWorkFlowNO"></param>
        bool SetWorkflowBaseVariable(bool bIsSubmit,string sWorkFlowNO)
        {
            NameCollection ncFinance = WorkFlowUtil.GetUsersInGroup("wf_FinanceConfirm");
            if (null == ncFinance || ncFinance.Count == 0)
            {
                DisplayMessage("There are no users in wf_FinanceConfirm");
                return false;
            }
            Employee employee = WorkFlowUtil.GetNextApprover(this.Userinfo1.Applicant);/// WorkFlowUtil.GetUsersInGroup("wf_FinanceConfirm");
            if (null == employee)
            {
                DisplayMessage(this.Userinfo1.Applicant.UserAccount+" has no manager in System!");
                return false;
            }
            NameCollection manager = new NameCollection();
            manager.Add(employee.UserAccount);
            string sDelePerson = WorkFlowUtil.GetDeleman(employee.UserAccount, WorkFlowUtil.GetModuleIdByListName("PurchaseRequestGeneral")); //查找代理人
            if (sDelePerson != null)
            {
                manager.Add(sDelePerson);
            }

            WorkflowContext context = WorkflowContext.Current;
            context.UpdateWorkflowVariable("IsSubmit", bIsSubmit);
            context.UpdateWorkflowVariable("IsSaveAgin", false);
            context.UpdateWorkflowVariable("EditUrl", "/_Layouts/CA/WorkFlows/PurchaseRequestGeneral/EditForm.aspx");//EditUrl
            context.UpdateWorkflowVariable("EditTitle", "Please complete Purchase Ruequest-General:" + sWorkFlowNO);//
            context.UpdateWorkflowVariable("ApproveURL", "/_Layouts/CA/WorkFlows/PurchaseRequestGeneral/ApproveForm.aspx");//ApproveURL
            context.UpdateWorkflowVariable("ApproveTitle", sWorkFlowNO + " needs approve");//ApproveTitle
            context.UpdateWorkflowVariable("ApproveUsers", manager);
            context.UpdateWorkflowVariable("ComfirmURL", "/_Layouts/CA/WorkFlows/PurchaseRequestGeneral/ConfirmForm.aspx");//ComfirmURL
            context.UpdateWorkflowVariable("ConfirmTitle", sWorkFlowNO + " needs confirm"); //ConfirmTitle
            context.UpdateWorkflowVariable("IsApproveAgin", false);
            context.UpdateWorkflowVariable("ConfirmUsers", ncFinance);
            return true;
        }
开发者ID:porter1130,项目名称:C-A,代码行数:41,代码来源:NewForm.aspx.cs


注:本文中的NameCollection类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。