/// <summary> /// email reminder /// </summary> /// <param name="currentUser">current user</param> /// <param name="request">request info</param> /// <param name="nextUser">next action users</param> /// <param name="comments">remark</param> public static void SendMail(UserInfo currentUser, RequestInfo request, FlowInfo flow, List <ApproverInfo> nextUser, string comments) { switch (flow.Status) { case FlowStatus.Submitted: SendMailToApproval(request, currentUser, nextUser); break; case FlowStatus.Approved: SendMailToEng(request, currentUser, nextUser); break; case FlowStatus.Closed: SendMailForClose(request, currentUser); break; case FlowStatus.Rejected: SendMailForReject(request, currentUser, comments); break; case FlowStatus.Canceled: SendMailForCancel(request, currentUser); break; default: break; } }
/// <summary> /// 按钮操作 /// </summary> private async void Action_Execution(object para = null) { switch (para) { case "Update": if (IpgwSetting.Instance.LatestFlow is null) { FlowInfo info = XmlDataProvider.Instance.GetNode <FlowInfo>(-1); if (info is null) { info = IpgwLoginService.Instance.GetLatestFlow(); } IpgwSetting.Instance.LatestFlow = info; } _updatebutton.IsEnabled = false; await IpgwLoginService.Instance.Update(() => { _updatebutton.IsEnabled = true; IPGWCore.Instence.UpdateAreaIcon(); }); break; case "DisConnect": IpgwLoginService.Instance.Logout(); break; default: break; } }
private void Bind() { FlowInfo flow = new FlowInfo(); flow.Time = DateTime.Now; flow.AdId = int.Parse(hidAdId.Value); flow.FlowUserId = int.Parse(hidFlowUserId.Value); flow.AdUserID = Account.UserId; DataTable table = AnalysisFlowBLL.Instance.GetPageAnalysis(flow); if (table.Rows.Count != 0) { ltIp.Text = table.Rows[0]["ipcount"].ToString(); ltPv.Text = table.Rows[0]["pvcount"].ToString(); ltUserAvg.Text = table.Rows[0]["useravg"].ToString(); ltUv.Text = table.Rows[0]["uvcount"].ToString(); ltIp1.Text = table.Rows[0]["ipcount"].ToString(); ltPv1.Text = table.Rows[0]["pvcount"].ToString(); ltUserAvg1.Text = table.Rows[0]["useravg"].ToString(); ltUv1.Text = table.Rows[0]["uvcount"].ToString(); } DataTable table1 = AnalysisFlowBLL.Instance.GetBrowseHour(flow); var chart = AnalysisFlowBLL.Instance.GetAdBrowseHour(table1); hidDataJson.Value = DN.Framework.Utility.Serializer.SerializeObject(chart); rptTable.DataSource = table1; rptTable.DataBind(); }
/// <summary> /// 按广告分析 /// </summary> /// <param name="flow"></param> /// <returns></returns> public DataTable GetAllAdDetail(FlowInfo flow) { StringBuilder sb = new StringBuilder(); if (flow.AdId.HasValue) { sb.AppendFormat(" and AdId = {0} ", flow.AdId); } if (flow.FlowUserId.HasValue) { sb.AppendFormat(" and FlowUserId = {0} ", flow.FlowUserId); } if (flow.AdUserID.HasValue) { sb.AppendFormat(" and AdUserId = {0} ", flow.AdUserID); } string cmd = string.Format(@"select time ,AdId ,count(*) as pvcount ,count(distinct(clientid)) as uvcount ,count(distinct(clientip)) as ipcount ,count(distinct(clientid)) /count(*) as useravg from [AdBrowseHistory] where time={0} {1} group by time,AdId", flow.Time.ToString("yyyyMMdd"), sb); ChartPara cp = new ChartPara(); cp.CommandText = cmd; DataTable table = acc.GetTable(cp); return(table); }
public static int CreateFlow(FlowInfo flow) { int FlowId = _flow.CreateFlow(flow); flow.FlowId = FlowId; return(FlowId); }
/// <summary> /// 生成当天的最大小时数据 /// </summary> /// <param name="userid"></param> /// <param name="time"></param> /// <returns></returns> public DataTable GetBrowseHour(FlowInfo flow) { StringBuilder sb = new StringBuilder(); if (flow.AdId.HasValue) { sb.AppendFormat(" and AdId = {0} ", flow.AdId); } if (flow.FlowUserId.HasValue) { sb.AppendFormat(" and FlowUserId = {0} ", flow.FlowUserId); } if (flow.AdUserID.HasValue) { sb.AppendFormat(" and AdUserId = {0} ", flow.AdUserID); } ChartPara cp = new ChartPara(); cp.CommandText = string.Format(@"select * from ( select count(*) as pvcount ,count(distinct(clientid)) as uvcount ,count(distinct(clientip)) as ipcount ,count(distinct(clientid)) /count(*) as useravg ,left(convert(varchar(10), CreateDate, 108), 2) as time from [AdBrowseHistory] where time = {0} {1} group by left(convert(varchar(10), CreateDate, 108), 2) ) a order by a.time asc", flow.Time.ToString("yyyyMMdd"), sb); //数据 DataTable table = acc.GetTable(cp); return(table); }
private void Bind() { FlowInfo flow = new FlowInfo(); //flow.UserId = Account.UserId; flow.Time = DateTime.Parse(txtTime.Value); if (!string.IsNullOrEmpty(ddlAdPage.SelectedValue)) { flow.AdId = int.Parse(ddlAdPage.SelectedValue); } ltStime.Text = flow.Time.ToString("yyyy-MM-dd"); ltEtime.Text = flow.Time.ToString("yyyy-MM-dd"); DataTable table = AnalysisFlowBLL.Instance.GetPageAnalysis(flow); if (table.Rows.Count != 0) { ltIp.Text = table.Rows[0]["ipcount"].ToString(); ltPv.Text = table.Rows[0]["pvcount"].ToString(); ltUserAvg.Text = table.Rows[0]["useravg"].ToString(); ltUv.Text = table.Rows[0]["uvcount"].ToString(); } DataTable table1 = AnalysisAdBLL.Instance.GetAllAdUserDetail(flow); rptTable.DataSource = table1; rptTable.DataBind(); }
public ActionResult ViewCase(int id) { FlowInfo flowInfo = PrepareViewCase(id); ApplicationUser manager = new ApplicationUser(WFEntities, this.Username); manager.UpdateLastChecked(id, this.Username); ViewBag.History = manager.GetCaseHistory(flowInfo.CaseInfo.FlowCaseId, flowInfo.CaseInfo.BaseFlowCaseId); var flowType = WFEntities.WF_FlowTypes.FirstOrDefault(p => p.FlowTypeId == flowInfo.FlowTypeId); ViewBag.FlowType = flowType; //ViewBag.Cities = Entities.Cities.ToArray(); if (flowType.TemplateType.HasValue) { if (flowType.TemplateType.Value == 7) { var properties = manager.GetProperties(id); var prop = properties.PropertyInfo.FirstOrDefault(p => p.PropertyName.ToLower().Equals("brand") && p.StatusId < 0); if (prop != null) { var brand = properties.Values.FirstOrDefault(p => p.PropertyId == prop.FlowPropertyId)?.StringValue; var shopList = WFEntities.BLSShopView .Where(s => s.Brand.ToLower().Equals(brand.ToLower())) .Select(s => new { s.ShopCode, s.ShopName }) .ToDictionary(s => s.ShopCode, s => s.ShopName); ViewBag.ShopList = shopList; } } } return(PartialView(flowInfo)); }
public ActionResult ViewCase(int flowCaseId) { ApplicationUser manager = new ApplicationUser(WFEntities, this.Username); PropertiesValue properties = manager.GetProperties(flowCaseId); FlowInfo info = manager.GetFlowAndCase(flowCaseId); manager.SetCaseAsViewed(flowCaseId, this.Username); manager.UpdateLastChecked(flowCaseId, this.Username); WF_FlowTypes flowType = manager.GetFlowTypeById(info.FlowTypeId); if (flowType.TemplateType.HasValue && flowType.TemplateType.Value == 7) { WF_FlowPropertys prop = properties.PropertyInfo.FirstOrDefault(p => p.PropertyName.ToLower().Equals("brand") && p.StatusId < 0); if (prop != null) { string brand = properties.Values.FirstOrDefault(p => p.PropertyId == prop.FlowPropertyId)?.StringValue; Dictionary <string, string> shopList = WFEntities.BLSShopView .Where(s => s.Brand.ToLower().Equals(brand.ToLower())) .Select(s => new { s.ShopCode, s.ShopName }) .ToDictionary(s => s.ShopCode, s => s.ShopName); ViewBag.ShopList = shopList; } } ViewBag.Properties = properties; ViewBag.Attachments = manager.GetAttachments(flowCaseId); ViewBag.FlowType = flowType; ViewBag.History = manager.GetCaseHistory(info.CaseInfo.FlowCaseId, info.CaseInfo.BaseFlowCaseId); return(PartialView(info)); }
public IHttpActionResult GetLegalReview(string projectId, Guid?Id = null) { var tempClosure = TempClosureInfo.FirstOrDefault(tc => tc.ProjectId == projectId); var project = ProjectInfo.Get(projectId, FlowCode.TempClosure_LegalReview); var isActor = ProjectUsers.IsRole(projectId, ClientCookie.UserCode, ProjectUserRoleCode.AssetActor); TempClosureLegalReview entity; if (Id != null) { entity = TempClosureLegalReview.Get(Id.Value); } else { entity = TempClosureLegalReview.Get(projectId); } entity.IsProjectFreezed = entity.CheckIfFreezeProject(projectId); var nextRefTableId = new Guid(FlowInfo.GetRefTableId("TempClosurePackage", projectId)); var nextFlowStarted = ProjectInfo.Any(p => p.FlowCode == FlowCode.TempClosure_ClosurePackage && p.ProjectId == projectId && p.NodeCode != NodeCode.Start); //var haveTask = TaskWork.Any(t => t.RefID == projectId && t.TypeCode == FlowCode.TempClosure_LegalReview && t.Status == TaskWorkStatus.UnFinish && t.ReceiverAccount == ClientCookie.UserCode); var projectComment = ProjectComment.GetSavedComment(entity.Id, "TempClosureLegalReview", ClientCookie.UserCode); var isLegalStarted = ProjectInfo.IsFlowStarted(projectId, FlowCode.TempClosure_LegalReview); return(Ok(new { Info = tempClosure, LegalReview = entity, ProjectComment = projectComment != null ? projectComment.Content : "", Editable = project.Status == ProjectStatus.Finished && isActor && !nextFlowStarted && !entity.IsHistory, Recallable = project.Status != ProjectStatus.Finished && isActor && !entity.IsHistory && isLegalStarted, Savable = ProjectInfo.IsFlowSavable(projectId, FlowCode.TempClosure_LegalReview) })); }
public override void Run() { IWfBox owner = this.Owner as IWfBox; if (owner != null) { WaitDialogHelper.Show(); try { int firstSelectedIndex = BoxHelper.GetFirstSelectedIndex(owner); WorkItem workItem = BoxHelper.GetWorkItem(BoxHelper.GetDataRowView(owner, firstSelectedIndex), owner); if (!StringHelper.IsNull(workItem.ProinstId)) { FlowInfo info = new FlowInfo(); info.ProinstId = workItem.ProinstId; info.Dock = DockStyle.Fill; SmForm form = new SmForm(); form.Text = info.Text; form.StartPosition = FormStartPosition.CenterParent; form.ClientSize = info.Size; form.Controls.Add(info); form.ShowDialog(); } } finally { WaitDialogHelper.Close(); } } }
public IHttpActionResult EditMultipleProjects(PostEditProjects postEditProjects) { if (postEditProjects.EditProjects.Count > 0) { using (TransactionScope tranScope = new TransactionScope()) { var projectId = postEditProjects.ProjectId; var parentCode = postEditProjects.EditProjects[0].ParentCode; var projects = ProjectInfo.Search(pi => pi.ProjectId == projectId).ToList(); var usCode = projects[0].USCode; var store = StoreBasicInfo.GetStorInfo(usCode); var minExecuteSequence = postEditProjects.EditProjects.Min(p => p.ExecuteSequence); var maxExecuteSequance = postEditProjects.EditProjects.Max(p => p.ExecuteSequence); foreach (TopNavigator nav in postEditProjects.EditProjects) { var workflow = BaseWFEntity.GetWorkflowEntity(postEditProjects.ProjectId, nav.Code); workflow.Edit(); } string[] cancelWorkflowCodes = FlowInfo.Search(f => f.ParentCode == parentCode && f.ExecuteSequence <= maxExecuteSequance + 1).Select(f => f.Code).ToArray(); TaskWork.Cancel(t => cancelWorkflowCodes.Contains(t.TypeCode) && t.RefID == postEditProjects.ProjectId && t.Status != TaskWorkStatus.Finished); postEditProjects.EditProjects.Where(n => n.ExecuteSequence == minExecuteSequence).ToList().ForEach(n => { var project = projects.FirstOrDefault(pi => pi.FlowCode == n.Code); var originator = Employee.GetSimpleEmployeeByCode(project.CreateUserAccount); var source = FlowInfo.Get(n.ParentCode); var taskType = FlowInfo.Get(n.Code); TaskWork task = new TaskWork(); task.Id = Guid.NewGuid(); task.SourceCode = source.Code; task.SourceNameENUS = source.NameENUS; task.SourceNameZHCN = source.NameZHCN; task.Status = TaskWorkStatus.UnFinish; task.StatusNameZHCN = "任务"; task.StatusNameENUS = "任务"; task.Title = TaskWork.BuildTitle(postEditProjects.ProjectId, store.NameZHCN, store.NameENUS); task.RefID = postEditProjects.ProjectId; task.StoreCode = usCode; task.ReceiverAccount = originator.Code; task.ReceiverNameENUS = originator.NameENUS; task.ReceiverNameZHCN = originator.NameZHCN; task.TypeCode = taskType.Code; task.TypeNameENUS = taskType.NameENUS; task.TypeNameZHCN = taskType.NameZHCN; task.Url = TaskWork.BuildUrl(n.Code, projectId, ""); task.CreateTime = DateTime.Now; task.CreateUserAccount = ClientCookie.UserCode; task.Sequence = 0; task.ActivityName = "Start"; task.Add(); }); tranScope.Complete(); } return(Ok()); } else { return(BadRequest("you must select projects to be edited!")); } }
/// <summary> /// 获取已使用流量 /MB /// </summary> /// <param name="info">流量信息</param> private double GetUsedFlow(FlowInfo info) { if (info is null) { return(0); } return(info.Data); }
private static void SendMail(UserInfo currentUser, RequestInfo request, FlowInfo flow, Dictionary <ApproverInfo, RoleType> nextUser, string comments) { // send mail List <ApproverInfo> taskUsers = new List <ApproverInfo>(); taskUsers.AddRange(nextUser.Keys); MailHandler.SendMail(currentUser, request, flow, taskUsers, comments); }
private FlowInfo PrepareViewCase(int id) { ApplicationUser manager = new ApplicationUser(WFEntities, this.Username); FlowInfo flowInfo = manager.GetFlowAndCase(id); ViewBag.Properties = manager.GetProperties(id); ViewBag.Attachments = manager.GetAttachments(id); return(flowInfo); }
private void Bind() { FlowInfo flow = new FlowInfo(); flow.Time = DateTime.Parse(txtTime.Value); if (!string.IsNullOrEmpty(ddlAdPage.SelectedValue)) { flow.AdId = int.Parse(ddlAdPage.SelectedValue); } ltStime.Text = flow.Time.ToString("yyyy-MM-dd"); ltAdTitle.Text = ddlAdPage.SelectedItem.Text; QueryGroupInfo query = new QueryGroupInfo(); query.Time = DateTime.Parse(txtTime.Value); query.GroupBy = " time "; DataTable table = LogBrowseAnalysisBLL.Instance.GetAnalysis(query); if (table.Rows.Count != 0) { ltIp.Text = table.Rows[0]["ipcount"].ToString(); ltPv.Text = table.Rows[0]["pvcount"].ToString(); ltUv.Text = table.Rows[0]["uvcount"].ToString(); ltIp1.Text = table.Rows[0]["ipcount"].ToString(); ltPv1.Text = table.Rows[0]["pvcount"].ToString(); ltUv1.Text = table.Rows[0]["uvcount"].ToString(); } else { ltIp.Text = "0"; ltPv.Text = "0"; ltUv.Text = "0"; ltIp1.Text = "0"; ltPv1.Text = "0"; ltUv1.Text = "0"; } DataTable table1 = LogBrowseAnalysisBLL.Instance.GetBrowseHour(query); int hour = int.Parse(DateTime.Now.ToString("HH")); if (flow.Time.ToString("yyyyMMdd") != DateTime.Now.ToString("yyyyMMdd")) { hour = 24; } var chart = ChartComonBLL.GetAdBrowseHour(table1, hour); hidDataJson.Value = DN.Framework.Utility.Serializer.SerializeObject(chart); rptTable.DataSource = table1; rptTable.DataBind(); }
public static bool IsParallelLastApprover(string userid, FlowInfo flow) { List <string> groups = OrgMgr.GetGroups(userid); if (groups.Count > 0) { userid = groups[0]; } return(_flow.IsLastApprover(userid, flow)); }
public static FlowInfo CreateChildFlow(FlowInfo parent, FlowStatus status) { FlowInfo childflow = new FlowInfo(); childflow.ReqId = parent.ReqId; childflow.ParentId = parent.FlowId; childflow.Status = status; childflow.FlowId = CreateFlow(childflow); return(childflow); }
public ActionResult ViewCase(int id) { ApplicationUser manager = new ApplicationUser(WFEntities, this.Username); FlowInfo flowInfo = manager.GetFlowAndCase(id); ViewBag.Properties = manager.GetProperties(id); ViewBag.Attachments = manager.GetAttachments(id); ViewBag.DisplayButtons = false; return(PartialView("~/Views/Pending/ViewCase.cshtml", flowInfo)); }
public static IList <ActionType> GetRequestPermission(int taskId, FlowInfo flow, RequestInfo reqInfo, string userId) { List <ActionType> actions = new List <ActionType>(); TaskInfo ts = WorkflowMgr.GetOpenTask(taskId); #region taskowners' permissions // ReqID<0 if for new creation request, no need check open task. if (ts != null && (ts.UID.ToLower() == userId.ToLower() || OrgMgr.GetGroups(userId).Contains(ts.UID))) { switch (flow.Status) { case FlowStatus.Created: actions.Add(ActionType.Submit); break; case FlowStatus.Submitted: actions.Add(ActionType.Approve); actions.Add(ActionType.Reject); break; case FlowStatus.Approved: actions.Add(ActionType.Commit); break; } } #endregion #region requstor's permissions if (RequestMgr.IsRequestOwner(userId, reqInfo)) { switch (flow.Status) { case FlowStatus.Created: actions.Add(ActionType.Submit); break; case FlowStatus.Submitted: case FlowStatus.Approved: actions.Add(ActionType.Cancel); break; default: break; } } #endregion return(actions); }
private static void SF_MoveAfterTaskDone(UserInfo currentUser, FlowInfo flow, RequestInfo request, ActionType action, string comments) { FlowStatus nextStatus = flow.Status; switch (flow.Status) { #region case RequestStatus.Created case FlowStatus.Created: switch (action) { case ActionType.Submit: nextStatus = FlowStatus.Submitted; break; default: throw new Exception("Wrong Action"); } break; #endregion #region case RequestStatus.Submitted case FlowStatus.Submitted: switch (action) { case ActionType.Approve: if (WorkflowMgr.IsLastApprover(currentUser.UID, flow)) { nextStatus = FlowStatus.Approved; } break; case ActionType.Reject: nextStatus = FlowStatus.Rejected; WorkflowMgr.CancelAllOtherTasks(currentUser, flow, action); break; case ActionType.Cancel: nextStatus = FlowStatus.Canceled; WorkflowMgr.CancelAllOtherTasks(currentUser, flow, action); // if cancel, then not need manager approval any more. break; default: throw new Exception("Wrong Action"); } break; #endregion } if (nextStatus != flow.Status) { SF_MoveTo(currentUser, flow, nextStatus, request, comments); } }
private void downloadData() { Cursor = Cursors.WaitCursor; _flows.Clear(); _filteredflows.Clear(); flowsList1.flowList.DataContext = null; try { XmlDocument doc; string func; if (radioButton1.Checked) { func = "GETOWN"; } else { func = "GETPUBLIC"; } if (ServerCall(func, null, out doc) == 0) { XmlNodeList nl = doc.SelectNodes("/Response/flows/flow"); if (nl != null) { foreach (XmlNode n in nl) { FlowInfo fi = new FlowInfo(); fi.Author = n.SelectSingleNode("Username").InnerText; fi.Created = DateTime.Parse(n.SelectSingleNode("Created").InnerText); fi.Modified = DateTime.Parse(n.SelectSingleNode("Modified").InnerText); fi.Description = n.SelectSingleNode("FlowDescription").InnerText; fi.IsPublic = bool.Parse(n.SelectSingleNode("IsPublic").InnerText); fi.Name = n.SelectSingleNode("FlowName").InnerText; fi.ID = n.SelectSingleNode("FlowID").InnerText; _flows.Add(fi); if (textBox2.Text.Length == 0 || fi.Name.IndexOf(textBox2.Text, StringComparison.InvariantCultureIgnoreCase) >= 0 || fi.Author.IndexOf(textBox2.Text, StringComparison.InvariantCultureIgnoreCase) >= 0 || fi.Description.IndexOf(textBox2.Text, StringComparison.InvariantCultureIgnoreCase) >= 0) { _filteredflows.Add(fi); } } flowsList1.flowList.DataContext = _filteredflows; } } } catch { MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_SERVERERROR), Utils.LanguageSupport.Instance.GetTranslation(STR_SERVERERROR), MessageBoxButtons.OK, MessageBoxIcon.Error); } Cursor = Cursors.Default; }
private static void AddTasks(Dictionary <ApproverInfo, RoleType> nextUser, FlowInfo flow) { if (nextUser.Count == 0) { return; } // add task foreach (var u in nextUser) { WorkflowMgr.AddTask(u.Key.UID, flow.FlowId, u.Value); } }
public ServerConnectionForm(ActionBuilder owner, Framework.Interfaces.ICore core) : this() { _owner = owner; _core = core; var af = (owner.ChildForm as ActionBuilderForm).AvailableActionFlows; if (af != null) { foreach (var a in af) { ActionImplementation startAction = (from sa in a.Actions where sa is ActionStart select sa).FirstOrDefault(); if (startAction != null) { FlowInfo fi = new FlowInfo(); fi.Author = ""; fi.Created = DateTime.MinValue; fi.Modified = DateTime.MinValue; fi.Description = ""; fi.Name = a.Name; fi.ID = startAction.ID; fi.IsPublic = false; fi.ActionFlow = a; comboBox1.Items.Add(fi); } } } flowsList1.flowList.SelectionChanged += new System.Windows.Controls.SelectionChangedEventHandler(flowList_SelectionChanged); this.Text = string.Format("{0} - {1}", Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE1), Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE2)); this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SERVERFLOWS); this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_YOURFLOWS); this.radioButton1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_YOURUPLOADED); this.radioButton2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ALLPUBLICFLOWS); this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DESCRIPTION); this.label6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DESCRIPTION); flowsList1.flowList.Columns[0].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME); flowsList1.flowList.Columns[1].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHOR); flowsList1.flowList.Columns[2].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_CREATED); flowsList1.flowList.Columns[3].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_MODIFIED); flowsList1.flowList.Columns[4].Header = Utils.LanguageSupport.Instance.GetTranslation(STR_PUBLIC); this.button3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DOWNLOAD); this.button4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_DELETE); this.label4.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_FLOW); this.button5.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_UPLOAD); this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PUBLIC); this.button6.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OK); }
static void cpu_InstructionPending(object sender, InstructionPendingEventArgs e) { if (e.ProgramCounter < programMemory.Size) { Word instruction = e.Instruction; string binRepresentation = instruction.ToString(); string friendlyOperationName = "███"; var operationAttribute = e.OperationUnit.GetType().GetCustomAttributes <Core.Compiler.Parsing.AssemblyCodeAttribute>().FirstOrDefault(); if (operationAttribute != null) { //TODO: handle fixed constants? friendlyOperationName = operationAttribute.FriendlyName; } if (FlowMonitoringMapping != null) { if (!FlowMonitoringMapping.ContainsKey(e.ProgramCounter)) { FlowMonitoringMapping.Add(e.ProgramCounter, new FlowInfo() { CallCount = 1, LastCallGeneration = e.Cpu.StateGeneration }); } else { FlowInfo info = FlowMonitoringMapping[e.ProgramCounter]; if (info.LastCallGeneration == e.Cpu.StateGeneration) { //reached same instruction, without state change => endless loop Console.WriteLine("Endless loop detected at following instruction:"); //awaiting t inside this event handler would hang var t = virtualSystem.SuspendAsync(); } else { info.LastCallGeneration = e.Cpu.StateGeneration; info.CallCount++; } } } Console.WriteLine("Executing: {1,4:X} | {2} {3} @ {0,-3} | {4}", e.ProgramCounter, instruction.UnsignedValue, binRepresentation.Substring(0, 8), binRepresentation.Substring(8, 8), friendlyOperationName); } else { Console.WriteLine("Executing: [Out of memory bounds] @ {0,-3}", e.ProgramCounter); } }
public Tuple <int, List <FlowTaskDo> > GetFlowInfoBySelf(FlowInfo model) { Mapper.Initialize(a => { a.CreateMap <FlowInfo, FlowTaskDo>() .ForMember(de => de.FlowCategory, op => { op.MapFrom(s => s.WorkFlowInfo.SortInfo.DicValue); }) .ForMember(de => de.UserName, op => { op.MapFrom(s => s.Userinfo.UserReallyname); }) .ForMember(de => de.FlowName, op => { op.MapFrom(s => s.WorkFlowInfo.FlowName); }) .ForMember(de => de.FlowRemark, op => { op.MapFrom(s => s.WorkFlowInfo.remark); }); }); using (var dal = BaseInfo._container.Resolve <UnitOfWork>()) { var messageRepository = dal.GetRepository <FlowInfo>(); var conditions = ExpandHelper.True <FlowInfo>().And(a => a.UserId == model.UserId); if (model.FlowId > 0) { conditions = conditions.And(a => a.FlowId == model.FlowId); } if (model.UserId > 0) { conditions = conditions.And(a => a.UserId == model.UserId); } if (model.WorkFlowInfo != null) { conditions = conditions.And(a => a.WorkFlowInfo.FlowName.Contains(model.WorkFlowInfo.FlowName)); } var templist = dal.GetRepository <FlowInfo>().Get(conditions, includeProperties: "WorkFlowInfo,Userinfo,WorkFlowInfo.SortInfo").ProjectToQueryable <FlowTaskDo>(); var count = templist.Count(); if (model.order != null && model.order.Count() > 0) { foreach (var item in model.order) { var column = model.columns.ElementAt(int.Parse(item.column)); templist = templist.OrderSort(column.data, item.dir); } } var result = templist.PageBy(model.pageIndex, model.pageSize).ToList(); return(new Tuple <int, List <FlowTaskDo> >(count, result)); } }
private void Bind() { FlowInfo flow = new FlowInfo(); flow.AdUserID = Account.UserId; flow.Time = DateTime.Now; if (!string.IsNullOrEmpty(ddlAdPage.SelectedValue)) { flow.AdId = int.Parse(ddlAdPage.SelectedValue); } DataTable table1 = AnalysisAdBLL.Instance.GetAdFlowDetail(flow); rptTable.DataSource = table1; rptTable.DataBind(); }
public ActionResult StartFlow(FormCollection form) { // var req = CommonHelper.GetStreamInfo(ControllerContext); var fileName = ""; if (HttpContext.Request.Files.Count > 0) { HttpPostedFileBase Portrait = HttpContext.Request.Files[0]; fileName = DateTime.Now.ToString("yyyyMMdd") + "-" + Path.GetFileName(Portrait.FileName).Replace("&", ""); var sysPath = Server.MapPath("~/FlowFiles"); if (!Directory.Exists(sysPath)) { Directory.CreateDirectory(sysPath); } var filePath = Path.Combine(sysPath, fileName); Portrait.SaveAs(filePath); } var req = new List <string>(); var elementInfo = this.FormInfoService.GetElementInfo(int.Parse(form["formid"])); elementInfo.ForEach(a => { if (a.element.ElementType != "upload") { req.Add(a.FieldIden + "=" + form[a.FieldIden].ToString()); } else { req.Add(a.FieldIden + "=" + fileName); } }); var flowingo = new FlowInfo(); flowingo.FormId = int.Parse(form["formid"]); flowingo.FlowId = int.Parse(form["flowid"]); flowingo.CreateTime = DateTime.Now; flowingo.UserId = UserInfo.UserID; this.FormInfoService.ExecuteFlow(flowingo, req); return(Json(new ResultEntity() { result = true })); }
public ActionResult EditCase(int id) { ApplicationUser manager = new ApplicationUser(WFEntities, this.Username); FlowInfo flowInfo = manager.GetFlowAndCase(id); var properties = manager.GetProperties(id); ViewBag.Properties = properties; var attachments = manager.GetAttachments(id); ViewBag.Attachments = attachments; ViewBag.FinalNotifyUsers = manager.GetFinalNotifyUsers(id); var flowType = WFEntities.WF_FlowTypes.FirstOrDefault(p => p.FlowTypeId == flowInfo.FlowTypeId); ViewBag.FlowType = flowType; ViewBag.HasCoverDuties = WFEntities.WF_FlowGroups.FirstOrDefault(p => p.FlowTypeId == flowInfo.FlowTypeId && p.StatusId > 0)?.HasCoverUsers; ViewBag.LeaveTypes = WFUtilities.GetLeaveType(RouteData.Values["lang"] as string); if (flowType.TemplateType.HasValue) { if (flowType.TemplateType.Value == 1) { ViewBag.Cities = WFEntities.Cities.Where(p => p.CountryCode == Country).AsNoTracking().ToArray(); } else if (flowType.TemplateType.Value == 7) { var prop = properties.PropertyInfo.FirstOrDefault(p => p.PropertyName.ToLower().Equals("brand") && p.StatusId < 0); if (prop != null) { var brand = properties.Values.FirstOrDefault(p => p.PropertyId == prop.FlowPropertyId)?.StringValue; var shopList = WFEntities.BLSShopView .Where(s => s.Brand.ToLower().Equals(brand.ToLower())) .Select(s => new { s.ShopCode, s.ShopName }) .ToDictionary(s => s.ShopCode, s => s.ShopName); ViewBag.ShopList = shopList; } } else if (flowType.TemplateType.Value == 2) { UserStaffInfo userInfo = WFUtilities.GetUserStaffInfo(this.Username); double balance = userInfo?.LeaveBalance ?? 0; double notstarted = manager.GetNotStartedBalance(Username); double unapproved = manager.GetUnApprovedBalance(Username); ViewBag.DisplayBalance = notstarted + balance; ViewBag.ValidBalance = balance > unapproved ? balance - unapproved : 0; } } return(PartialView(flowInfo)); }
public ActionResult GetSreachFlowInfo(FlowInfo model, string FlowName = "") { model.UserId = this.UserInfo.UserID; if (FlowName != "") { model.WorkFlowInfo = new WorkFlow() { FlowName = FlowName } } ; var result = this.FlowTaskService.GetFlowInfoBySelf(model); return(JsonResult(result, true)); }
private void button4_Click(object sender, EventArgs e) { FlowInfo fi = flowsList1.flowList.SelectedItem as FlowInfo; if (fi != null) { Dictionary <string, string> pars = new Dictionary <string, string>(); pars.Add("id", fi.ID); XmlDocument doc; if (ServerCall("DELETEFLOWID", pars, out doc) == 0) { downloadData(); } } }
public static NodeInfo From(FlowInfo flowInfo, Node node) { NodeInfo nodeInfo; if (!nodeInfos.TryGetValue(node, out nodeInfo)) nodeInfos.Add(node, nodeInfo = new NodeInfo(flowInfo, node)); return nodeInfo; }
private NodeInfo(FlowInfo flowInfo, Node node) { FlowInfo = flowInfo; Node = node; NodeAnchorBinder.PropertyChanged += NodeAnchorBinder_PropertyChanged; }
private void LoadFlowInfo() { WaitDialogHelper.Show(); try { FlowInfo info; if (!this.pFlowInfo.HasChildren) { info = new FlowInfo(); info.Dock = DockStyle.Fill; this.pFlowInfo.Controls.Add(info); } else { info = this.pFlowInfo.Controls[0] as FlowInfo; } if (LoggingService.IsDebugEnabled) { LoggingService.DebugFormatted("将显示业务编号:{0} 的流程信息", new object[] { this.workItem.ProjectId }); } info.ProinstId = this.workItem.ProinstId; } finally { WaitDialogHelper.Close(); } }
public void Save(FlowInfo flowInfo) { Type flowType = flowInfo.Flow.GetType(); FlowStorageAttribute flowStorage = flowType.GetCustomAttribute<FlowStorageAttribute>(); try { if (string.IsNullOrEmpty(flowInfo.Path) || !File.Exists(flowInfo.Path)) { SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = string.Format("{0} ({1})|{1}", flowStorage.Description, string.Join(";", flowStorage.Extensions.Select(e => "*" + e))); saveFileDialog.FilterIndex = 1; if (saveFileDialog.ShowDialog() != true) return; flowInfo.Path = saveFileDialog.FileName; } flowInfo.Flow.Save(flowInfo.Path); Log.Info("Saved flow to \"{0}\"", flowInfo.Path); flowInfo.History.Clear(); } catch (Exception e) { Error.Show(e, "An error occurred while saving your flow", App.Name); } }
public static VariableInfo From(FlowInfo flowInfo, Variable variable) { VariableInfo variableInfo; if (!variableInfos.TryGetValue(variable, out variableInfo)) variableInfos.Add(variable, variableInfo = new VariableInfo(flowInfo, variable)); return variableInfo; }
private VariableInfo(FlowInfo flowInfo, Variable variable) { Variable = variable; FlowInfo = flowInfo; }
public FlowDebugger(FlowInfo flowInfo) { FlowInfo = flowInfo; }
private void button3_Click(object sender, EventArgs e) { FlowInfo fi = flowsList1.flowList.SelectedItem as FlowInfo; if (fi != null) { Dictionary<string, string> pars = new Dictionary<string, string>(); pars.Add("id", fi.ID); XmlDocument doc; if (ServerCall("GETFLOWID", pars, out doc) == 0) { try { //extract flow xml XmlNode nl = doc.SelectSingleNode("/Response/FlowContent"); if (nl != null) { string xmlDoc = nl.InnerText; //add to current flows if ((_owner.ChildForm as ActionBuilderForm).ImportXmlFlow(xmlDoc)) { //add to combo comboBox1.Items.Clear(); var af = (_owner.ChildForm as ActionBuilderForm).AvailableActionFlows; if (af != null) { foreach (var a in af) { ActionImplementation startAction = (from sa in a.Actions where sa is ActionStart select sa).FirstOrDefault(); if (startAction != null) { FlowInfo afi = new FlowInfo(); afi.Author = ""; afi.Created = DateTime.MinValue; afi.Modified = DateTime.MinValue; afi.Description = ""; afi.Name = a.Name; afi.ID = startAction.ID; afi.IsPublic = false; afi.ActionFlow = a; comboBox1.Items.Add(afi); } } } comboBox1_SelectedIndexChanged(this, EventArgs.Empty); if (radioButton1.Checked) { downloadData(); } MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_DOWNLOADSUCCESS), Utils.LanguageSupport.Instance.GetTranslation(STR_SUCCESS), MessageBoxButtons.OK, MessageBoxIcon.Information); } } } catch { MessageBox.Show(Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR), Utils.LanguageSupport.Instance.GetTranslation(STR_ERROR), MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void NewFlowCommandCallback(object parameter) { XFlow flow = new XFlow(); FlowInfo flowInfo = new FlowInfo(flow, null); Flows.Add(flowInfo); CurrentFlow = flowInfo; }
public AddNodeAction(FlowInfo flow, Node node) { FlowInfo = flow; Node = node; }
public FSNSnapshot snapshot; // 스냅샷 (본체) #endregion Fields #region Constructors //======================================================================= public Segment() { Flows = new FlowInfo[4]; FlowDirection = FSNInGameSetting.FlowDirection.None; BackDirection = FSNInGameSetting.FlowDirection.None; }
public void Open(string path) { Log.Info("Opening \"{0}\"", path); FileInfo fileInfo = new FileInfo(path); if (!fileInfo.Exists) { MessageBox.Show("Could not find specified file " + path, "FlowTomator", MessageBoxButton.OK, MessageBoxImage.Error); return; } FlowInfo flowInfo = null; string error = ""; try { EditableFlow flow = EditableFlow.Load(fileInfo.FullName); flowInfo = new FlowInfo(flow, fileInfo.FullName); } catch (Exception e) { error = e.Message; if (System.Diagnostics.Debugger.IsAttached) System.Diagnostics.Debugger.Break(); } if (flowInfo == null || flowInfo.Flow == null) { MessageBox.Show("Could not open specified file " + path + "." + Environment.NewLine + error, "FlowTomator", MessageBoxButton.OK, MessageBoxImage.Error); return; } Flows.Add(flowInfo); NotifyPropertyChanged(nameof(Flows)); }