public void Create(StateView view) { State state = UnitOfWork.To <State>(view); UnitOfWork.Insert(state); UnitOfWork.Commit(); }
public Sungero.Core.StateView GetStateView() { var stateView = StateView.Create(); var skipResolutionBlock = false; var statusesCache = new Dictionary <Enumeration?, string>(); foreach (var task in _obj.ResolutionGroup.ActionItemExecutionTasks) { var stateViewModel = Structures.ActionItemExecutionTask.StateViewModel.Create(); stateViewModel.StatusesCache = statusesCache; var blocks = PublicFunctions.ActionItemExecutionTask.GetActionItemStateView(task, task, stateViewModel, null, string.Empty, null, null, skipResolutionBlock, false).Blocks; statusesCache = stateViewModel.StatusesCache; // Убираем первый блок с текстовой информацией по поручению. foreach (var block in blocks.Skip(1)) { stateView.AddBlock(block); } // Строим блок резолюции только для первого поручения. skipResolutionBlock = true; } return(stateView); }
public Sungero.Core.StateView GetStateView() { var stateView = StateView.Create(); var comment = Docflow.PublicFunctions.Module.GetTaskUserComment(_obj, Resources.ConsiderationText); if (_obj.Status != Workflow.Task.Status.Aborted) { if (_obj.Started.HasValue) { Docflow.PublicFunctions.OfficialDocument .AddUserActionBlock(stateView, _obj.Author, DocumentReviewTasks.Resources.StateViewDocumentSent, _obj.Started.Value, _obj, comment, _obj.StartedBy); } else { Docflow.PublicFunctions.OfficialDocument .AddUserActionBlock(stateView, _obj.Author, Docflow.ApprovalTasks.Resources.StateViewTaskDrawCreated, _obj.Created.Value, _obj, comment, _obj.Author); } } var startDate = this.GetIterationStartDate(); var managerBlock = this.AddReviewManagerBlock(stateView, startDate); if (managerBlock != null) { this.AddPreraringDraftResolutionBlock(managerBlock, startDate); this.AddReviewResolutionBlock(managerBlock, startDate); } return(stateView); }
public Sungero.Core.StateView GetStateView() { var stateView = StateView.Create(); // Добавить блок информации к блоку задачи. var taskHeader = VerificationTasks.Resources.StateViewTaskBlockHeader; this.AddInformationBlock(stateView, taskHeader, _obj.Started.Value); // Блок информации о задаче. var taskBlock = this.AddTaskBlock(stateView); // Получить все задания по задаче. var taskAssignments = VerificationAssignments.GetAll(a => Equals(a.Task, _obj)).OrderBy(a => a.Created).ToList(); // Статус задачи. var status = _obj.Info.Properties.Status.GetLocalizedValue(_obj.Status); var lastAssignment = taskAssignments.OrderByDescending(a => a.Created).FirstOrDefault(); if (!string.IsNullOrWhiteSpace(status)) { Docflow.PublicFunctions.Module.AddInfoToRightContent(taskBlock, status); } // Блоки информации о заданиях. foreach (var assignment in taskAssignments) { var assignmentBlock = this.GetAssignmentBlock(assignment); taskBlock.AddChildBlock(assignmentBlock); } return(stateView); }
// modify a certain state on a certain script public static void modifyStateOnCertainScript(StateView stateView, bool makeHistory) { if (CurrentSelectedScriptIndex < 0) { return; } string origContentText = ""; if (!(mOpenedScriptList[CurrentSelectedScriptIndex].getStateModelById(stateView.Id) is null)) { origContentText = mOpenedScriptList[CurrentSelectedScriptIndex].getStateModelById(stateView.Id).ContentText; } mOpenedScriptList[CurrentSelectedScriptIndex].modifyState(stateView); mOpenedScriptList[CurrentSelectedScriptIndex].HaveUnsavedChanges = true; // add a record in its own history management if (makeHistory) { HistoryManager.Do(mOpenedScriptList[CurrentSelectedScriptIndex]); } Program.form.MarkUnsavedScript(); // update the cbb at from as well if (!(mOpenedScriptList[CurrentSelectedScriptIndex].getStateModelById(stateView.Id) is null) && origContentText != stateView.StateContent) { Program.form.updateExistedObject(getStateModelByIdAtCurrentScript(stateView.Id)); } // debugPrint(); }
// select the object in cbb: state public void selectExistedObject(StateModel state) { if (state is null || cbbExistedStates is null || cbbExistedStates.Items is null || scriptsTabControl is null || scriptsTabControl.SelectedTab is null) { return; } cbbExistedStates.SelectedIndex = cbbExistedStates.Items.IndexOf(state); ScriptCanvas canvas = ((ScriptTabPage)scriptsTabControl.SelectedTab).TheScriptCanvas; if (canvas is null) { return; } StateView stateView = canvas.getStateViewById(state.Id); if (stateView is null) { return; } ModelManager.showInfoPanel(stateView); //((ScriptTabPage)scriptsTabControl.SelectedTab).TheScriptCanvas.translateToState(stateView); }
public Sungero.Core.StateView GetStateView() { var stateView = StateView.Create(); stateView.AddDefaultLabel(Docflow.OfficialDocuments.Resources.StateViewDefault); var minutes = Minuteses.GetAll(d => Equals(d.Meeting, _obj)); var documentsGroupGuid = Docflow.PublicConstants.Module.TaskMainGroup.ActionItemExecutionTask; var actionItems = RecordManagement.ActionItemExecutionTasks.GetAll() .Where(t => t.AttachmentDetails.Any(g => g.GroupId == documentsGroupGuid && minutes.Any(m => m.Id == g.AttachmentId))) .OrderBy(task => task.Created); var statusesCache = new Dictionary <Enumeration?, string>(); foreach (var actionItem in actionItems) { if (stateView.Blocks.Any(b => b.HasEntity(actionItem))) { continue; } var stateViewModel = Sungero.RecordManagement.Structures.ActionItemExecutionTask.StateViewModel.Create(); stateViewModel.StatusesCache = statusesCache; var blocks = RecordManagement.PublicFunctions.ActionItemExecutionTask.GetActionItemStateView(actionItem, actionItem, stateViewModel, null, string.Empty, null, null, true, false).Blocks; statusesCache = stateViewModel.StatusesCache; // Убираем первый блок с текстовой информацией по поручению. foreach (var block in blocks.Skip(1)) { stateView.AddBlock(block); } } return(stateView); }
public ActionResult DeleteConfirmed(int id) { StateView stateView = db.States.Find(id); db.States.Remove(stateView); db.SaveChanges(); return RedirectToAction("Index"); }
public void Edit(StateView view) { State state = UnitOfWork.To <State>(view); UnitOfWork.Update(state); UnitOfWork.Commit(); }
public void Initialize(StateView stateView) { this.stateView = stateView; // I don't think we need to do anything here yet, but we may want to know // when the state stacking mode changes.. }
public override void handleMousePositionChanged(Point init_position) { Point position = calcFinalPoint(init_position); StateView.changePosition(init_position); HoverView.setHoveredObject(handler.hoverCheck(position), scroll_amount - TOP_MARGIN, current_left); DragView.updateDragRect(init_position); }
protected override void Awake() { base.Awake(); stateView = GetComponentInParent <StateView>(); buttonAnimation = GetComponent <ButtonAnimation>(); buttonAnimation?.SetOwner(this); buttonAnimation?.ChangeState(buttonAnimation.currentState); }
private void stateToolStripMenuItem_Click(object sender, EventArgs e) { Form sForm = StateView.Instance(); sForm.MdiParent = this; sForm.Show(); sForm.Activate(); }
public void ShowStateView(StateView nextView, bool lockView, UnityAction callback) { if (this.lockView) { return; } this.onNextViewOpen = callback; ShowStateView(nextView, lockView); }
public ActionResult Edit([Bind(Include = "StateId,Name,Abbreviation,CountryId")] StateView stateView) { if (ModelState.IsValid) { db.Entry(stateView).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(stateView); }
public void ShowStateView(StateView nextView, bool lockView) { if (this.lockView) { return; } this.lockView = lockView; this.nextView = nextView; ChangeState(state.showView); }
public void Get_ReturnsViewById() { StateView actual = service.Get <StateView>(state.Id); StateView expected = Mapper.Map <StateView>(state); Assert.Equal(expected.CreationDate, actual.CreationDate); Assert.Equal(expected.Id, actual.Id); Assert.True(false, "Not all properties tested"); }
public ActionResult Create([Bind(Exclude = "Id")] StateView state) { if (!Validator.CanCreate(state)) { return(View(state)); } Service.Create(state); return(RedirectIfAuthorized("Index")); }
public ActionResult Edit(StateView state) { if (!Validator.CanEdit(state)) { return(View(state)); } Service.Edit(state); return(RedirectIfAuthorized("Index")); }
/// <summary> /// Построить модель контрола состояния документа. /// </summary> /// <param name="document">Документ.</param> /// <returns>Модель контрола состояния.</returns> public Sungero.Core.StateView GetStateView(Sungero.Docflow.IOfficialDocument document) { if (_obj.AllAttachments.Any(d => Equals(document, d))) { return(this.GetStateView()); } else { return(StateView.Create()); } }
public void TestSetSunStatesNoErrors() { var v = new StateView { Sun = SunState.Happy }; v.Sun = SunState.Shocked; v.Sun = SunState.Cool; v.Sun = SunState.Dead; }
public ActionResult Create([Bind(Include = "StateId,Name,Abbreviation,CountryId")] StateView stateView) { if (ModelState.IsValid) { db.States.Add(stateView); db.SaveChanges(); return RedirectToAction("Index"); } return View(stateView); }
/// <summary> /// Построить модель состояния процесса ознакомления. /// </summary> /// <param name="document">Документ.</param> /// <returns>Схема модели состояния.</returns> public Sungero.Core.StateView GetStateView(IElectronicDocument document) { if (_obj.DocumentGroup.OfficialDocuments.Any(d => Equals(document, d)) || _obj.AddendaGroup.OfficialDocuments.Any(d => Equals(document, d))) { return(this.GetStateView()); } else { return(StateView.Create()); } }
public StatesControllerTests() { validator = Substitute.For <IStateValidator>(); service = Substitute.For <IStateService>(); state = ObjectFactory.CreateStateView(); controller = Substitute.ForPartsOf <StatesController>(validator, service); controller.ControllerContext = new ControllerContext { RouteData = new RouteData() }; }
public Usuario(StateView state) { InitializeComponent(); this.state = state; user = new User(); controller = new DCUser(); this.DataContext = user; ConfigureView(); SetBindings(); this.Owner = Application.Current.MainWindow; }
public void Create_State() { StateView view = ObjectFactory.CreateStateView(1); service.Create(view); State actual = context.Set <State>().AsNoTracking().Single(model => model.Id != state.Id); StateView expected = view; Assert.Equal(expected.CreationDate, actual.CreationDate); Assert.True(false, "Not all properties tested"); }
// GET: StateViews/Delete/5 public ActionResult Delete(int? id) { if (id == null) { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } StateView stateView = db.States.Find(id); if (stateView == null) { return HttpNotFound(); } return View(stateView); }
// not yet implement public void translateToState(StateView srcStateView) { foreach (StateView stateView in mExistedStateViewList) { int newX = stateView.Location.X - srcStateView.Location.X + Size.Width / 2; int newY = stateView.Location.Y - srcStateView.Location.Y + Size.Height / 2; stateView.relocateState(newX, newY, false); stateView.OutlineGphPath.Reset(); } foreach (LinkView linkView in mExistedIngoingLinks) { } Invalidate(); }
// drag-dropped, a new state-view added on current script protected override void OnDragDrop(DragEventArgs e) { //var bmp = (Bitmap) e.Data.GetData(DataFormats.Bitmap); // get the client point Point clientPoint = PointToClient(new Point(e.X, e.Y)); // add the state at the location of client point StateView newStateView = null; switch (MouseManager.CurrentHoldingType) { case StateType.START: newStateView = new StartStateView(clientPoint.X, clientPoint.Y, "", true); break; case StateType.END: newStateView = new EndStateView(clientPoint.X, clientPoint.Y, "", true); break; case StateType.GENERAL: // prompt the typing form to get the state content from user string newStateContent = promptTypingFormAndGetTypedText(); // if the result is null, means that user cancels the addition of state if (!(newStateContent is null)) { newStateView = new GeneralStateView(clientPoint.X, clientPoint.Y, newStateContent, true); } break; } if (!(newStateView is null)) { // resize the state with current scale newStateView.Size = new Size((int)(newStateView.Size.Width * currentScale), (int)(newStateView.Size.Height * currentScale)); newStateView.resetPortPositions(); // add the state-view AddStateView(newStateView, textArgb: Color.Black.ToArgb()); } // reset both the holding type and dragging to NONE MouseManager.CurrentHoldingType = StateType.NONE; // paint on the picture-box Invalidate(); }
// add a new state-view public void AddStateView(StateView newStateView, string id = null, int bgArgb = 0, int textArgb = 0) { // add model ModelManager.addNewStateOnCertainScript(new StateModel(ref newStateView, id, bgArgb, textArgb)); // add view Controls.Add(newStateView); mExistedStateViewList.Add(newStateView); // show info panel ModelManager.showInfoPanel(newStateView); // invalidate the start-state-view on the shell if needs Program.form.getCertainStateViewOnTheShell(0).Invalidate(); }
public void Edit_State() { StateView view = ObjectFactory.CreateStateView(state.Id); Assert.True(false, "No update made"); service.Edit(view); State actual = context.Set <State>().AsNoTracking().Single(); State expected = state; Assert.Equal(expected.CreationDate, actual.CreationDate); Assert.Equal(expected.Id, actual.Id); Assert.True(false, "Not all properties tested"); }
public Usuario(StateView state, User user) : this(state) { this.user = user; this.DataContext = user; }