private async Task AddBillingPlans(PlanList list) { foreach (var plan in list.Plans) { //add Billing plans in the database var billingPlan = new BillingPlan(); billingPlan.PayPalPlanId = plan.Id; billingPlan.Type = plan.Type; billingPlan.Name = plan.Name; billingPlan.Description = plan.Description; billingPlan.State = plan.State; if (plan.PaymentDefinitions != null) { billingPlan.PaymentFrequency = plan.PaymentDefinitions.FirstOrDefault().Frequency; billingPlan.PaymentInterval = plan.PaymentDefinitions.FirstOrDefault().FrequencyInterval; } else { billingPlan.PaymentFrequency = "Not Provided"; billingPlan.PaymentInterval = "Not Provided"; } billingPlan.ReturnURL = "https://www.andytipsterpro.com/"; billingPlan.CancelURL = "https://www.andytipsterpro.com/"; billingPlan.CreateTime = plan.CreateTime; billingPlan.UpdateTime = plan.UpdateTime; _dbContext.BillingPlans.Add(billingPlan); } await _dbContext.SaveChangesAsync(); }
private void PlanList_MouseClick(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Right) { return; } PlanListItem clicked = PlanList.GetItemAt(e.Location) as PlanListItem; if (clicked == null) { return; } ContextMenuStripEx menu = new ContextMenuStripEx(); if (Selected.Person == Core.UserID) { menu.Items.Add(new PlanMenuItem("Edit", clicked.Item, null, Plan_Edit)); menu.Items.Add("-"); menu.Items.Add(new PlanMenuItem("Delete", clicked.Item, PlanRes.delete, Plan_Delete)); } else { menu.Items.Add(new PlanMenuItem("Details", clicked.Item, PlanRes.details, Plan_View)); } menu.Show(PlanList, e.Location); }
private void Load(Entity.PlanFilter filter) { //this.IsShowTitleList = true; this.PlanList = PlanMGMT.BLL.PlanBLL.Instance.GetPlanList(filter.GenerateFilter(), "InCharge,Status,PlanStart"); if (this.PlanList == null) { return; } if (this.PlanList.Count >= 0) { this.PlanMsg = "共有 " + this.PlanList.Count + " 条记录,您可点的左侧按钮改变显示模式..."; if (PlanList.Count > 0) { List <string> uers = PlanList.Select(x => x.InCharge).Distinct().ToList <string>(); List <Model.PlanByName> incharges = new List <Model.PlanByName>(); foreach (var u in uers) { incharges.Add(new Model.PlanByName(u, LoginBLL.Instance.GetUserNameByCode(u))); } InChargeList = incharges; } else { InChargeList = null; } } }
private IEnumerator LoadPlan() { WWW getData = new WWW(GameController.PlanUrl); yield return(getData); if (getData.error != null) { Debug.Log(getData.error); } else { Debug.Log(getData.text); UIGrid grid = PlanList.GetComponentInChildren <UIGrid>(); foreach (Transform cell in grid.transform) { Destroy(cell.gameObject); } string[] plans = JsonHelper.FromJson <string>("{\"Items\":" + getData.text + "}"); foreach (var plan in plans) { GameObject labelGameObject = Resources.Load("UI/Label") as GameObject; labelGameObject.GetComponent <UILabel>().text = plan; grid.gameObject.AddChild(labelGameObject); } grid.repositionNow = true; } }
private List <PlanList> GetItems() { var TheTable = DB.conn.Table <Plan>().OrderBy(x => x.DatePerformed).ToList(); if (TheTable.Count != 0) { var start = TheTable.First().DatePerformed; var end = TheTable.Last().DatePerformed; var ListOfPlanList = new List <PlanList>(); for (var currWeek = getWeek(start); currWeek <= getWeek(end); currWeek = currWeek.AddDays(7)) { var currWeekList = new PlanList { FirstDayOfWeek = currWeek }; foreach (var plan in TheTable.Where(x => x.DatePerformed >= currWeek && x.DatePerformed < currWeek.AddDays(7))) { currWeekList.Add(plan); } if (currWeekList.Count > 0) { ListOfPlanList.Add(currWeekList); } } return(ListOfPlanList); } else { return(new List <PlanList>()); } }
private void PlanList_MouseDoubleClick(object sender, MouseEventArgs e) { PlanListItem item = PlanList.GetItemAt(e.Location) as PlanListItem; if (item == null) { return; } if (Selected == null) { return; } bool local = (Selected.Person == Core.UserID); EditItemMode mode = local ? EditItemMode.Edit : EditItemMode.View; EditPlanItem form = new EditPlanItem(mode, Selected, item.Item); if (form.ShowDialog(this) == DialogResult.OK) { if (local) { View.ChangesMade(); } } }
public ActionResult <IEnumerable <Plan> > Get() { var ListPlan = PlanList.GetListPlan(); if (ListPlan == null) { return(BadRequest()); } return(Ok(ListPlan)); }
public void SaveList(ClaimsIdentity identity, Int32 id, String name) { var userId = identity.GetUserId(); var list = new PlanList() { Id = id, Name = name }; this._repository.SaveList(userId, list); this._repository.SaveChanges(); }
public IActionResult Put([FromBody] Plan PlanP) { if (ModelState.IsValid) { if (!PlanList.UpdatePlan(PlanP)) { return(BadRequest()); } return(Ok(PlanP)); } return(BadRequest()); }
public IActionResult Post([FromBody] Plan PlanP) { if (ModelState.IsValid) { if (!PlanList.AddPlan(PlanP)) { return(BadRequest()); } return(Created(Url.Action("Post", PlanP.id), PlanP)); } return(BadRequest()); }
/// <summary> /// 调度计划按钮点击事件 /// </summary> public void PlanListButtonClick() { //PlanList.SetActive(!PlanList.activeSelf); if (PlanList.activeSelf) { PlanList.SetActive(false); } else { PlanList.SetActive(true); StartCoroutine(LoadPlan()); } }
public void SaveList(string userId, PlanList list) { if (list.Id == 0) { var user = CurrentUser(userId); list.User = user; user.Lists.Add(list); } else { var old = Get(userId, list.Id); old.Name = list.Name; } }
public IActionResult Delete(int IdP) { var PlanAux = PlanList.GetPlan(IdP); if (PlanAux == null) { return(NotFound()); } if (!PlanList.RemovePlan(IdP)) { return(BadRequest()); } return(Ok("Plan removed!")); }
public ActionResult <Plan> Get(int IdP) { try { var PlanAux = PlanList.GetPlan(IdP).First(); if (PlanAux == null) { return(BadRequest()); } return(Ok(PlanAux)); } catch (InvalidOperationException) { return(NotFound()); } }
internal void SearchBySponsor(string name) { if (PlanList == null) { PlanList = planBusiness.Read(); } if (PlansDictionary == null) { PlansSponsorDictionary = PlanList.ToDictionary(p => p.Sponsor.Name, p => p); } var results = PlansSponsorDictionary.Where(plan => plan.Key.Contains(name)).Select(plan => plan.Value); foreach (var item in results) { Console.WriteLine(item.ToString()); } }
public void AddNewPlanOfDay() { Plan tempPlan = new Plan(); tempPlan.ChefKok = insertPlan.ChefKok; tempPlan.Help1 = insertPlan.Help1; tempPlan.Help2 = insertPlan.Help2; tempPlan.Help3 = insertPlan.Help3; tempPlan.ExtraHelp = insertPlan.ExtraHelp; tempPlan.Clean1 = insertPlan.Clean1; tempPlan.Clean2 = insertPlan.Clean2; tempPlan.Clean3 = insertPlan.Clean3; tempPlan.Clean4 = insertPlan.Clean4; tempPlan.Menu = insertPlan.Menu; PlanList.Add(tempPlan); }
public ReturnData GetPlans() { ReturnData rd = new ReturnData(); try { var plans = (from s in db.Plan_Master join c in db.Rate_Card on s.Plan_ID equals c.Plan_Id where c.Status == "Active" select new { s.Plan_ID, c.Rate_Id, s.Plan, c.Amount }).ToList(); if (plans.Count <= 0) { rd.Status = "Failure"; rd.Message = "Plans not found"; rd.Requestkey = "GetPlans"; return(rd); } List <PlanList> PlanList = new List <PlanList>(); for (int i = 0; i < plans.Count; i++) { PlanList cm = new PlanList(); cm.Plan_ID = Convert.ToDecimal(plans[i].Plan_ID); cm.Rate_Id = plans[i].Rate_Id; cm.Plan = plans[i].Plan; cm.Amount = plans[i].Amount; PlanList.Add(cm); rd.Plans = PlanList; } rd.Status = "Success"; rd.Message = "Plans found"; rd.Requestkey = "GetPlans"; return(rd); } catch (Exception) { rd.Status = "Failure"; rd.Message = "Something went wrong. Please try after some time."; rd.Requestkey = "GetPlans"; return(rd); } }
public void LoadPlans(PlanList list, string url, int page = 1) { list.ShowLoadingPanel(); RestClient.Get <ServerResponse <List <Plan> > > (App.instance.config.host + url + "?page=" + page.ToString()).Then((result) => { if (page > 1) { List <Plan> data = list.GetData(); data.AddRange(result.data); list.SetData(data); } else { list.SetData(result.data); } }).Catch((error) => { list.ShowErrorPanel(); }); }
private void DeleteConfirm_Closed(object sender, EventArgs e) { CustomMessage customMesage = sender as CustomMessage; if (customMesage.DialogResult == true) { IsEditing = false; if (PlanList.Contains(SelectPlanEntity)) { DeletedPlanList.Add(SelectPlanEntity); PlanList.Remove(SelectPlanEntity); } SelectPlanEntity = null; EditingPlanEntity = new PlanEntity(); uneditedPlanEntity = null; UpdateChanged("EditingOriginalName"); IsChanged = true; } }
private void CreatePlans(Goal g, GameObject target, Precondition successCondition, PlanList plans, Plan p, List <Action> ignoreList) { List <Action> satisfyingActions = actionDirectory.FindActionsSatisfyingGoalCondition(target, successCondition); RemovePreviouslyFailedActions(satisfyingActions, currentGoal.FailedActions); foreach (Action action in satisfyingActions) { Plan newPlan = new Plan(p); newPlan.AddAction(action); if (!action.HasPrecondition() || action.IsPreconditionSatisfied()) { plans.Add(newPlan); } else { CreatePlans(g, target, action.Precondition, plans, newPlan, ignoreList); } } }
public PaymentsController() { this.apiContext = Common.GetApiContext(); this.customerId = Common.GetCustomerId(); this.plans = Plan.List(apiContext, status: "ACTIVE"); }
IEnumerator ManageGoals() { while (goalDirectory.GoalList.Count() > 0) { currentGoal = null; foreach (Goal g in goalDirectory.GoalList) { if (g.IsSatisfied()) { if (g.Type == GoalType.Pursuit) { Testing.WriteToLog(transform.name, transform.name + " achieved goal: " + g.Name); goalDirectory.RemoveGoal(g); } else if (g.Type == GoalType.Interest && !g.Dormant) { Testing.WriteToLog(transform.name, transform.name + " achieved goal: " + g.Name); g.Dormant = true; } yield return(new WaitForSeconds(manager.GetRandomInt(2, 8))); } else { currentGoal = g; if (currentGoal.Type == GoalType.Interest) { currentGoal.Dormant = false; } break; } } //if the goal isn't satisifed then check if the goal has a plan associated with it. if (currentGoal != null) { if (currentGoal.TimesFailed >= Goal.MaxFail) { currentGoal.ClearFailedActions(); } //If the goal hasn't got a plan then let's create one! if (currentGoal.Plan == null) { Testing.WriteToLog(transform.name, transform.name + " is evaluating " + Testing.GetGoalInfo(currentGoal)); //create a plan // Create a LinkedList to store the plans and populate it. PlanList planList = new PlanList(); CreatePlans(currentGoal, currentGoal.TargetCharacter, currentGoal.SuccessCondition, planList, new Plan(), currentGoal.FailedActions); // If there are no plans in the collection then the goal is already satisifed or its impossible to reach. if (planList.Count() < 1) { // Set the goal to complete and it will be removed from the collection the next time Update() is run. currentGoal.Complete = true; Testing.WriteToLog(transform.name, transform.name + " cancelled goal: " + currentGoal.Name + " because a plan is impossible to make."); currentGoal.ClearFailedActions(); Testing.WriteToLog(transform.name, "Clearing previously failed action list in attempt to satisfy goal..."); } // If we successfully constructed one or more plans then we need to pick one for the agent to use. else { Testing.WriteToLog(transform.name, transform.name + " created at least one plan for goal: " + currentGoal.Name); //pick a plan from List<LinkedList<Action>> plans and assign to g.plan currentGoal.SetPlan(planList.GetBestPlan(manager, actionQueue, GetComponent <MemoryManager>(), transform)); Testing.WriteToLog(transform.name, transform.name + " nominated a best plan for goal: " + currentGoal.Name + ":"); Testing.WriteToLog(transform.name, Testing.GetPlanInfo(currentGoal.Plan)); } } // if the goal has got a plan... else { //manage its execution Plan plan = currentGoal.Plan; Action currentAction = plan.GetCurrentAction(); if (currentAction != null) { switch (currentAction.Status) { case Status.notSent: currentAction.SetStatus(Status.Sent); Testing.WriteToLog(transform.name, transform.name + " is queueing action: " + Testing.GetActionInfo(currentAction)); actionQueue.QueueAction(currentAction); break; case Status.Resend: currentAction.SetStatus(Status.ResendSent); actionQueue.QueueAction(currentAction); break; case Status.Failed: //action repair currentGoal.TimesFailed++; Testing.WriteToLog(transform.name, transform.name + " failed action: " + Testing.GetActionInfo(currentAction)); currentAction.SetStatus(Status.notSent); currentGoal.AddFailedAction(new Action(currentAction)); currentGoal.SetPlan(null); Testing.WriteToLog(transform.name, transform.name + " is replanning: " + Testing.GetGoalInfo(currentGoal)); yield return(new WaitForSeconds(manager.GetRandomInt(1, 3))); break; case Status.Successful: Testing.WriteToLog(transform.name, transform.name + " succeeded action: " + Testing.GetActionInfo(currentAction)); currentAction.SetStatus(Status.notSent); plan.RemoveAction(currentAction); yield return(new WaitForSeconds(manager.GetRandomInt(1, 3))); break; } } else { currentGoal.SetPlan(null); } } } yield return(null); } }
private void UpdatePlanItems(GoalNode node) { PlanListItem ReselectPlanItem = null; if (PlanList.SelectedItems.Count > 0) { ReselectPlanItem = PlanList.SelectedItems[0] as PlanListItem; } PlanList.Items.Clear(); if (node == null) { Selected = null; DelegateLink.Hide(); PlanList.Columns[0].Text = "Plan"; //splitContainer2.Panel1Collapsed = true; return; } Selected = node.Goal; // set delegate task vis if (Selected.Person == Core.UserID && Trust.HasSubs(Selected.Person, View.ProjectID)) { DelegateLink.Show(); } else { DelegateLink.Hide(); } if (Selected.Person == Core.UserID) { AddItemLink.Show(); } else { AddItemLink.Hide(); } // name's Plan for <goal> PlanList.Columns[0].Text = Core.GetName(node.Goal.Person) + "'s Plan for " + node.Goal.Title; // set plan items OpPlan plan = Plans.GetPlan(Selected.Person, true); if (plan == null) // re-searched at during selection { return; } if (plan.ItemMap.ContainsKey(Head.Ident)) { foreach (PlanItem item in plan.ItemMap[Head.Ident]) { if (item.BranchUp == Selected.BranchDown) { PlanListItem row = new PlanListItem(item); if (ReselectPlanItem != null && item == ReselectPlanItem.Item) { row.Selected = true; } PlanList.Items.Add(row); FormatTime(row); } } } PlanList.Invalidate(); }
public void AddItem(RLMPlan item) { PlanList.Add(item); }
public void OnOKCommand() { if (!editingPlanEntity.AccomplishDate.HasValue && editingPlanEntity.Score.HasValue) { Message.ErrorMessage("未设置完成时间!"); return; } else if (editingPlanEntity.AccomplishDate.HasValue && !editingPlanEntity.Score.HasValue) { Message.ErrorMessage("未设置分数!"); return; } if (editingPlanEntity.Score.HasValue && editingPlanEntity.Score.Value.CompareTo(editingPlanEntity.Weight) > 0) { Message.ErrorMessage("实际得分大于权重分值!"); return; } do { if (null != uneditedPlanEntity && uneditedPlanEntity.SequenceId == editingPlanEntity.SequenceId) { break; } foreach (PlanEntity item in PlanList) { if (null != uneditedPlanEntity && uneditedPlanEntity == item) { continue; } if (editingPlanEntity.SequenceId == item.SequenceId) { editingPlanEntity.SequenceId = (null != uneditedPlanEntity && null != uneditedPlanEntity.SequenceId) ? uneditedPlanEntity.SequenceId : GetNewSequenceId(editingPlanEntity.SequenceId); Message.ErrorMessage("序列号重复!"); return; } } } while (false); string getDepartmentName = string.Empty; if (DepartmentIdNameDictionary.TryGetValue(editingPlanEntity.DepartmentId, out getDepartmentName)) { editingPlanEntity.DepartmentName = getDepartmentName; } editingPlanEntity.SheetName = this.Title; if (PlanList.Count > 0) { editingPlanEntity.ManufactureNumber = PlanList[0].ManufactureNumber; } //editingPlanEntity.DUpdate(); if (null == uneditedPlanEntity) { PlanList.Add(editingPlanEntity); } else { for (int pos = 0; pos < PlanList.Count; ++pos) { PlanEntity item = PlanList[pos]; if (item.ManufactureNumber == uneditedPlanEntity.ManufactureNumber && item.VersionId == uneditedPlanEntity.VersionId && item.SequenceId == uneditedPlanEntity.SequenceId) { CopyPlanEntity(editingPlanEntity, ref item); break; } } } IsEditing = false; EditingPlanEntity = new PlanEntity(); uneditedPlanEntity = null; OnSelectionChangedCommand(); UpdateChanged("EditingOriginalName"); }