本文整理汇总了C#中NameCollection类的典型用法代码示例。如果您正苦于以下问题:C# NameCollection类的具体用法?C# NameCollection怎么用?C# NameCollection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NameCollection类属于命名空间,在下文中一共展示了NameCollection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: StartWorkflowButton_Executing
private void StartWorkflowButton_Executing(object sender, CancelEventArgs e)
{
//局部变量定义
WorkflowContext context = WorkflowContext.Current;
WorkflowDataFields fields = WorkflowContext.Current.DataFields;
var departmentManagerTaskUsers = new NameCollection();
var btn = sender as StartWorkflowButton;
string manager = string.Empty;
bool isCeo = false;
if (string.Equals(btn.Text, "Save", StringComparison.CurrentCultureIgnoreCase))
{
//判断输入数据是否正确,错误则直接返回
var msg = this.DataForm1.ValidateForSave();
if (msg.IsNotNullOrWhitespace())
{
DisplayMessage(msg);
e.Cancel = true;
return;
}
fields["Status"] = CAWorkflowStatus.Pending;
context.UpdateWorkflowVariable("IsSave", true);
context.UpdateWorkflowVariable("CompleteTaskTitle", "please complete Travel Request");
}
else
{
//判断输入数据是否正确,错误则直接返回
var msg = this.DataForm1.ValidateForSubmit();
if (msg.IsNotNullOrWhitespace())
{
DisplayMessage(msg);
e.Cancel = true;
return;
}
//以下代码获取上级审批人信息
var managerEmp = WorkFlowUtil.GetNextApprover(this.DataForm1.Applicant.UserAccount);
if (managerEmp == null)
{
isCeo = IsCEO(DataForm1.Applicant.UserAccount);
if (!isCeo)
{
DisplayMessage("The manager is not set in the system.");
e.Cancel = true;
return;
}
else
{
//获取前台确认的员工
departmentManagerTaskUsers = TravelRequest3Common.GetTaskUsersByModuleWithoutDeleman("wf_ReceptionCtrip_TR", "TravelRequestWorkFlow");
}
}
else
{
manager = managerEmp.UserAccount;
departmentManagerTaskUsers.Add(manager);
}
var deleman = WorkFlowUtil.GetDeleman(manager, "106");
if (deleman != null)
{
departmentManagerTaskUsers.Add(deleman);
}
context.UpdateWorkflowVariable("IsSave", false);
}
//WorkflowNumber
workflowNumber = CreateTRWorkFlowNumber();
//首先保存用户输入的数据
DataForm1.Update();
//保存详细信息
TravelRequest3Common.SaveDetails(DataForm1, workflowNumber);
//保存数据
Employee applicant = this.DataForm1.Applicant;
fields["Applicant"] = applicant != null ? applicant.DisplayName + "(" + applicant.UserAccount + ")" : string.Empty;
fields["ApplicantSPUser"] = SPContext.Current.Web.EnsureUser(applicant.UserAccount);
fields["Department"] = DataForm1.Department;
fields["Department"] = this.DataForm1.Department;
fields["TravelOtherPurpose"] = this.DataForm1.OtherPurpose;
var isBusiness = this.DataForm1.ChosenFlight;
var isNextFlight = this.DataForm1.NextFlight;
var isBookHotel = this.DataForm1.IsBookHotel;
fields["IsBusiness"] = isBusiness;
fields["IsNextFlight"] = isNextFlight;
fields["IsBookHotel"] = !isBookHotel;
fields["Managers"] = manager;
var flightClass = string.Empty;
if (isBusiness)
{
flightClass = "Business";
}
else if (isNextFlight)
{
flightClass = "Other available flight";
}
else
//.........这里部分代码省略.........
开发者ID:porter1130,项目名称:C-A,代码行数:101,代码来源:NewForm.aspx.cs
示例17: Actions_ActionExecuting
private void Actions_ActionExecuting(object sender, ActionEventArgs e)
{
WorkflowContext context = WorkflowContext.Current;
WorkflowDataFields fields = WorkflowContext.Current.DataFields;
switch (WorkflowContext.Current.Step)
{
case "NextApproveTask":
if (e.Action.Equals("Approve", StringComparison.CurrentCultureIgnoreCase))
{
var levelType = "Payment Approval Limits";
double total = Convert.ToDouble(fields["TotalAmount"].ToString());
var quota = WorkFlowUtil.GetQuota(fields["CurrManager"].ToString(), levelType);
if (total > quota)
{
#region Set users for workflow
var manager = new NameCollection();
var managerEmp = WorkFlowUtil.GetNextApprover(fields["CurrManager"].ToString());
//if it's CEO
if (managerEmp == null)
{
List<string> ceos = WorkflowPerson.GetCEO();
if (ceos.Count == 0)
{
DisplayMessage("The init error about WorkflowPerson in the system.");
e.Cancel = true;
return;
}
managerEmp = UserProfileUtil.GetEmployeeEx(ceos[0]);
}
ExpatriateBenefitClaimCommon.GetTaskUsers(manager, managerEmp.UserAccount);
#endregion
fields["CurrManager"] = managerEmp.UserAccount;
AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, "ApproversSPUser", "Approvers");
context.UpdateWorkflowVariable("NextApproveTaskUsers", manager);
context.UpdateWorkflowVariable("IsContinue", true);
}
else
{
context.UpdateWorkflowVariable("ConfirmTaskUsers", ExpatriateBenefitClaimCommon.GetTaskUsers(ExpatriateBenefitClaimConstants.wf_EBC_FinanceConfirm));
context.UpdateWorkflowVariable("IsContinue", false);
}
}
else
{
fields["Status"] = CAWorkflowStatus.Rejected;
context.UpdateWorkflowVariable("CompleteTaskTitle", "Please resubmit Expatriate Benefit Claim");
context.UpdateWorkflowVariable("IsContinue", false);
SendEmail("Reject");
}
AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, "ApproversSPUser", "Approvers");
break;
case "ConfirmTask":
if (e.Action == "Confirm")
{
fields["Status"] = CAWorkflowStatus.Completed;
if (fields["CashAdvanceWorkFlowNumber"] != null)
{
string workflowNumber = fields["CashAdvanceWorkFlowNumber"].ToString();
List<string> list = workflowNumber.Split(';').ToList<string>();
if (list.Count > 0)
{
foreach (string number in list)
{
if (number != "")
{
UpdateCashAdvanceStatus(number);
}
}
}
}
fields["ReasonsResult"] = "0";
if (IsExistSAP(fields["WorkflowNumber"].ToString()))
{
AddExpatriateBenefitClaimSAPWorkflow(fields);
}
}
if (e.Action == "Reject")
{
fields["Status"] = CAWorkflowStatus.Rejected;
this.DataForm.SavePendingForm();
context.UpdateWorkflowVariable("CompleteTaskTitle", "Please resubmit Expatriate Benefit Claim");
SendEmail("Reject");
}
if (e.Action == "Pending")
{
fields["Status"] = CAWorkflowStatus.Pending;
this.DataForm.SavePendingForm();
context.UpdateWorkflowVariable("ConfirmTaskUsers", ExpatriateBenefitClaimCommon.GetTaskUsers(ExpatriateBenefitClaimConstants.wf_EBC_FinanceConfirm));
SendEmail("Pending");
}
AddWorkFlowStepApprovers(WorkflowContext.Current.Task.Step, "ApproversSPUser", "Approvers");
break;
default:
//.........这里部分代码省略.........
开发者ID:porter1130,项目名称:C-A,代码行数:101,代码来源:ApproveForm.aspx.cs
示例18: GetTaskUsersWithoutDeleman
public static NameCollection GetTaskUsersWithoutDeleman(string group, string moduleId)
{
var taskUsers = new NameCollection();
List<string> groupUsers = null;
groupUsers = WorkFlowUtil.UserListInGroup(group);
taskUsers.AddRange(groupUsers.ToArray());
return taskUsers;
}
开发者ID:porter1130,项目名称:C-A,代码行数:10,代码来源:WorkFlowUtil.cs
示例19: GetTaskUsers
//Return task users object according to special group
public static NameCollection GetTaskUsers(string group, string moduleId)
{
var taskUsers = new NameCollection();
List<string> delemans = null;
List<string> groupUsers = null;
groupUsers = WorkFlowUtil.UserListInGroup(group);
taskUsers.AddRange(groupUsers.ToArray());
delemans = WorkFlowUtil.GetDelemans(groupUsers, moduleId);
//if (delemans.Count > 0)
//{
// taskUsers.AddRange(delemans.ToArray());
//}
foreach (var delegateAccount in delemans)
{
// Need to check whether the delegate account is valid.
if (UserProfileUtil.GetEmployeeEx(delegateAccount) != null)
{
taskUsers.Add(delegateAccount);
}
}
return taskUsers;
}
开发者ID:porter1130,项目名称:C-A,代码行数:26,代码来源:WorkFlowUtil.cs
示例20: StartWorkflowButton_Executing
private void StartWorkflowButton_Executing(object sender, CancelEventArgs e)
{
try
{
string taskTitle = string.Empty;
WorkflowContext context = WorkflowContext.Current;
WorkflowDataFields fields = WorkflowContext.Current.DataFields;
var btn = sender as StartWorkflowButton;
#region Save Common List Data
List<string> fieldsList = new List<string>()
{"Applicant",
"ApplicantSPUser",
"ChineseName",
"Department",
"EnglishName",
"Mobile",
"OfficeExt",
"IDNumber"};
workflowNumber = TravelExpenseClaimCommon.SaveListFields(requestId, "Travel Request Workflow2", fields, fieldsList);
#endregion
if (string.Equals(btn.Text, "Save", StringComparison.CurrentCultureIgnoreCase))
{
context.UpdateWorkflowVariable("IsSave", true);
fields["Status"] = CAWorkflowStatus.Pending;
context.UpdateWorkflowVariable("CompleteTaskTitle", "Please complete Travel Expense Claim");
}
else
{
#region Set Users for Workflow
var manager = new NameCollection();
SPUser applicantUser = SPContext.Current.Web.AllUsers.GetByID(Convert.ToInt32(fields["ApplicantSPUser"].AsString()));
var managerEmp = WorkFlowUtil.GetNextApprover(applicantUser.LoginName);
if (managerEmp == null)
{
if (!WorkflowPerson.IsCEO(applicantUser.LoginName))
{
DisplayMessage(&q
|
请发表评论