Example #1
0
        /// <summary>
        /// 获取操作状态
        /// </summary>
        /// <param name="o">审核状态</param>
        /// <param name="obj">编号</param>
        /// <param name="staffStatus">员工状态</param>
        /// <returns></returns>
        protected string GetApproveState(object o, object obj, object staffStatus)
        {
            string str = string.Empty;

            if (null != o && obj != null && staffStatus != null)
            {
                //员工离职审批状态
                if ((StaffStatus)staffStatus != StaffStatus.离职)
                {
                    ApprovalStatus m = (ApprovalStatus)o;
                    switch (m)
                    {
                    case ApprovalStatus.待审核:
                        str = string.Format("<a class='approve' data-class='inapprove' data-id='{0}' href='javascript:void(0)'>审核中</a>", obj.ToString());
                        break;

                    case ApprovalStatus.审核通过:
                        str = string.Format("<a class='approve' data-class='approved' data-id='{0}' href='javascript:void(0)'>可办理离职</a>", obj.ToString());
                        break;

                    case ApprovalStatus.审核未通过:
                        str = string.Format("<a class='approve' data-class='inapprove' data-id='{0}' href='javascript:void(0)'>审核中</a>", obj.ToString());
                        break;
                    }
                }
                //员工已经离职
                else
                {
                    str = string.Format("<a class='approve' data-class='approved' data-id='{0}' href='javascript:void(0)'>已离职</a>", obj.ToString());
                }
            }
            return(str);
        }
        private void ModifyMailboxApproval(ApprovalStatus approvalStatus)
        {
            IList <DataGridViewRow> checkedRows = (from DataGridViewRow row in mailboxDataGridView.Rows
                                                   where Convert.ToBoolean(row.Cells[MailboxRowCheckBox.Name].Value) == true
                                                   select row).ToList();

            WorkAsync(new WorkAsyncInfo
            {
                Message       = "Modifying mailboxes",
                IsCancelable  = true,
                AsyncArgument = checkedRows,
                Work          = (worker, args) => {
                    var rows = args.Argument as IList <DataGridViewRow>;
                    for (var i = 0; i < rows.Count(); i++)
                    {
                        DataGridViewRow row = rows[i];
                        string mailboxName  = row.Cells[2].Value as string;
                        worker.ReportProgress(-1, $"Modifying mailbox {mailboxName} to {approvalStatus}");

                        if (row.Cells[1].Value is Guid mailboxId)
                        {
                            MailboxDao mailboxDao       = new MailboxDao(Service);
                            Exception approvalException = mailboxDao.SetApproval(
                                mailboxId,
                                approvalStatus);

                            if (approvalException != null)
                            {
                                LogError($"Failed to approve mailbox");
                                LogError(approvalException.Message);
                                LogError(approvalException.StackTrace);
                            }
                        }
                    }
                },
                ProgressChanged = e =>
                {
                    SetWorkingMessage(e.UserState.ToString());
                },
                PostWorkCallBack = (args) =>
                {
                    if (args.Error != null)
                    {
                        MessageBox.Show(
                            args.Error.ToString(),
                            "Error",
                            MessageBoxButtons.OK,
                            MessageBoxIcon.Error);
                    }

                    TsbLoadMailboxes.Visible       = false;
                    TsbUpdateMailboxes.Visible     = false;
                    TsbSelectAll.Visible           = false;
                    TsbSelectNone.Visible          = false;
                    mailboxDataGridView.DataSource = null;
                    TscbActionType.SelectedIndex   = 0;

                    MessageBox.Show("Complete");
                }
            });
Example #3
0
 /// <summary>
 /// Checks whether assessment can be updated.
 /// </summary>
 /// <param name="entity">The assessment.</param>
 /// <param name="validStatus">The valid entity status for assessment approval.</param>
 /// <exception cref="AuthorizationException">
 /// If assessment's approval status doesn't match <paramref name="validStatus"/>.
 /// </exception>
 private static void CheckCanModify(Assessment entity, ApprovalStatus validStatus)
 {
     if (entity.ApprovalStatus != validStatus)
     {
         throw new AuthorizationException("Cannot update the assessment at current status.");
     }
 }
        public async Task <IActionResult> Create([Bind("ID,Name")] ApprovalStatus approvalStatus)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    _context.Add(approvalStatus);
                    await _context.SaveChangesAsync();

                    return(RedirectToAction("Index", new { approvalStatus.ID }));
                }
            }
            catch (DbUpdateException dex)
            {
                if (dex.GetBaseException().Message.Contains("UNIQUE constraint failed: ApprovalStatus.Name"))
                {
                    ModelState.AddModelError("Name", "Unable to save changes.You cannot have duplicate Approval Status Name.");
                }
                else
                {
                    ModelState.AddModelError("", "Unable to save changes.Try again,and if the problem persists see your system administrator.");
                }
            }

            return(View(approvalStatus));
        }
        public async Task <ResponseModel> SaveStatusAsync(ApprovalStatus model)
        {
            ResponseModel response  = new ResponseModel();
            var           newStatus = new ApprovalStatus()
            {
                Status = model.Status
            };

            if (model.Status.Any())
            {
                dbContext.ApprovalStatus.Add(newStatus);
                try
                {
                    dbContext.SaveChanges();
                    response.Message = "Saved Successfully";
                    response.Code    = 200;
                }
                catch (Exception ex)
                {
                    //Console.WriteLine($"Save Partner Status Error: {ex}");
                    response.Message = ex.Message;
                    response.Code    = 404;
                    dbContext.ApprovalStatus.Local.Clear();
                    ErrorLog log = new ErrorLog();
                    log.ErrorDate       = DateTime.Now;
                    log.ErrorMessage    = ex.Message;
                    log.ErrorSource     = ex.Source;
                    log.ErrorStackTrace = ex.StackTrace;
                    dbContext.ErrorLogs.Add(log);
                    dbContext.SaveChanges();
                }
            }
            return(response);
        }
Example #6
0
 private void AddApproProcess(string workId, string desc, ApprovalStatus status, FlowNodeEntity node, IRepositoryBase db)
 {
     if (node != null && !string.IsNullOrEmpty(node.Id))
     {
         ApprovalProcessEntity appproEntity = new ApprovalProcessEntity();
         appproEntity.Create();
         appproEntity.WorkId         = workId;
         appproEntity.ApprovalStatus = (int)status;
         appproEntity.NodeId         = node.Id;
         appproEntity.NodeName       = node.Name;
         appproEntity.Description    = desc;
         appproEntity.IsStart        = false;
         appproEntity.IsEnd          = false;
         var LoginInfo = OperatorProvider.Provider.GetCurrent();
         if (LoginInfo != null)
         {
             appproEntity.ApprovalUserId   = LoginInfo.UserId;
             appproEntity.ApprovalUserName = LoginInfo.UserName;
         }
         db.Insert(appproEntity);
     }
     else
     {
         throw new Exception("当前节点异常!");
     }
 }
Example #7
0
 protected ApprovalProcess(Guid promotionId, HashSet <Editor> editors)
 {
     Id               = Guid.NewGuid();
     PromotionId      = promotionId;
     Status           = ApprovalStatus.Pending;
     ApprovalRequests = editors.Select(e => new ApprovalRequest(e)).ToList();
 }
Example #8
0
 public IEnumerable <Thread> FindUserThreadsWithPostsAndTopic(int id, ApprovalStatus approvalStatus)
 {
     return(Context.Threads.AsNoTracking()
            .Include(x => x.Topic)
            .Include(x => x.Posts)
            .Where(x => x.CreatedById == id && x.ApprovalStatus == approvalStatus));
 }
 private FlowNodeEntity GetNextNodeId(string workId, ApprovalStatus approvalStatus, RejectType rejectType = RejectType.Last)
 {
     try
     {
         FlowNodeEntity nextNode = new FlowNodeEntity();
         using (var db = new RepositoryBase())
         {
             WorkEntity workEntity = db.FindEntity <WorkEntity>(m => m.Id == workId);
             if (workEntity != null && !string.IsNullOrEmpty(workEntity.Id))
             {
                 if (approvalStatus == ApprovalStatus.Pass)
                 {
                     if (string.IsNullOrEmpty(workEntity.CurrentNodeId))
                     {
                         FlowNodeEntity flowNodeEntity = db.FindEntity <FlowNodeEntity>(m => m.IsStartNode == true && m.FlowVersionId == workEntity.FlowVersionId);
                         if (flowNodeEntity != null && !string.IsNullOrEmpty(flowNodeEntity.Id))
                         {
                             workEntity.CurrentNodeId = flowNodeEntity.Id;
                         }
                     }
                     nextNode = GetNextNodeIdPass(workId, workEntity.CurrentNodeId, workEntity.FlowVersionId);
                 }
             }
         }
         return(nextNode);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private void tsbSave_Click(object sender, EventArgs e)
        {
            if (ValidateFields() == false)
            {
                return;
            }

            ApprovalStatus approvalStatus = ApprovalStatus.Pending;

            if (((ToolStripButton)sender).Name == "tsbSave")
            {
                approvalStatus = ApprovalStatus.Pending;
            }

            else if (((ToolStripButton)sender).Name == "tsbApprove")
            {
                approvalStatus = ApprovalStatus.Approved;
            }

            else if (((ToolStripButton)sender).Name == "tsbReject")
            {
                approvalStatus = ApprovalStatus.Rejected;
            }

            SaveCancellation(approvalStatus);
        }
 private void Clear()
 {
     txtRegistrationNo.Enabled = true;
     id = 0;
     txtRegistrationNo.Text     = "";
     txtName.Text               = "";
     txtClientID.Text           = "";
     txtSizeCode.Text           = "";
     txtTotalPrice.Text         = "0.00";
     txtRebatAmt.Text           = "0.00";
     txtNetRetailPrice.Text     = "0.00";
     txtBookingPrice.Text       = "0.00";
     dTRefundDate.Text          = "";
     txtProject.Text            = "";
     txtRemarks.Text            = "";
     txtProfit.Text             = "0.00";
     txtNetAmount.Text          = "0.00";
     txtDeduction.Text          = "0.00";
     txtTaxWithheld.Text        = "0.00";
     chkBoxApproved.Checked     = false;
     pBMemberRegistration.Image = null;
     pBMemberCNIC.Image         = null;
     EntryApproved              = ApprovalStatus.Pending;
     cmbApprovalStatus.Text     = "Not Saved";
     txtBookingDate.Clear();
     /////Enabling
     btnSelect.Enabled = true;
 }
Example #12
0
        public DataSet GetApprovalPrc_InfoByEmpID(int emp_ref_id, ApprovalStatus status)
        {
            string query = @"SELECT * FROM COM_APPROVAL_PRC WHERE (APP_STATUS = @APP_STATUS OR @APP_STATUS='*') and APP_EMP_ID = @APP_EMP_ID";

            string app_status = null;

            if (status == ApprovalStatus.None)
            {
                app_status = "*";
            }
            else if (status == ApprovalStatus.Created)
            {
                app_status = "C";
            }
            else if (status == ApprovalStatus.Pending)
            {
                app_status = "P";
            }
            else if (status == ApprovalStatus.Ended)
            {
                app_status = "E";
            }

            IDbDataParameter[] paramArray = CreateDataParameters(2);

            paramArray[0]       = CreateDataParameter("@APP_EMP_ID", SqlDbType.Int);
            paramArray[0].Value = emp_ref_id;
            paramArray[1]       = CreateDataParameter("@APP_STATUS", SqlDbType.Char);
            paramArray[1].Value = app_status;

            DataSet ds = DbAgentObj.FillDataSet(query, "APPROVALINFOGET_1", null, paramArray, CommandType.Text);

            return(ds);
        }
Example #13
0
        private void Clear()
        {
            id = 0;

            cmbApprovalStatus.Text = "Not Saved";
            txtRegistration.Text   = "";
            txtProject.Text        = "";
            txtBlock.Text          = "";
            txtPlot.Text           = "";

            txtClientID.Text        = "";
            txtName.Text            = "";
            cBFatherHusband.Text    = "";
            txtFatherHusband.Text   = "";
            txtNIDCNIC.Text         = "";
            cmbNationality.Text     = "";
            txtCurrentAddress1.Text = "";
            txtCurrentAddress2.Text = "";
            txtCurrentAddress3.Text = "";
            cmbCountry.Text         = "";
            txtCity.Text            = "";
            txtEmailAddress.Text    = "";
            txtMob.Text             = "";
            txtPh.Text                      = "";
            txtRes.Text                     = "";
            txtFax.Text                     = "";
            txtTransferID.Text              = "";
            txtTransferName.Text            = "";
            cmbTransferFatherHusband.Text   = null;
            txtTransferFatherHusband.Text   = "";
            cmbTransferNationality.Text     = null;
            dTPTransferDOB.Text             = "";
            txtTransferCurrentAddress1.Text = "";
            txtTransferCurrentAddress2.Text = "";
            txtTransferCurrentAddress3.Text = "";
            cmbTransferCountry.Text         = null;
            txtTransferCity.Text            = "";
            txtTransferPh.Text              = "";
            txtTransferRes.Text             = "";
            txtTransferMob.Text             = "";
            txtTransferEmailAddress.Text    = "";
            txtPictureName.Text             = "";
            txtTransferEmailAddress.Text    = "";


            pbTransferToImage.Image = null;
            txtPictureName.Text     = "";

            pbTransferToCNIC.Image = null;
            txtCNICName.Text       = "";

            pBMemberRegistration.Image = null;
            pBMemberCNIC.Image         = null;

            infoMember    = null;
            EntryApproved = ApprovalStatus.Pending;

            /////Enabling
            btnSelect.Enabled = true;
        }
        public async Task AddAproval(int requestId, string userId, bool isTechnician, string approverId, string subject, string description)
        {
            Request request = await this.repository.All().FirstOrDefaultAsync(r => r.Id == requestId);

            User author = await this.userManager.FindByIdAsync(userId);

            if (isTechnician || userId == request.RequesterId)
            {
                ApprovalStatus pendingStatus = await this.approvalStatusRepository.All().FirstOrDefaultAsync(s => s.Name == "Pending");

                RequestApproval approval = new RequestApproval
                {
                    Subject     = subject,
                    RequestId   = requestId,
                    Description = description,
                    RequesterId = userId,
                    ApproverId  = approverId,
                    StatusId    = pendingStatus.Id
                };

                request.Approvals.Add(approval);

                await this.SaveChangesAsync();
            }
        }
Example #15
0
        public IList<Package> FindByPackageTypeAndPrice(string packageType, ApprovalStatus status, double min, double max)
        {
            String hql = "select package from Package package where ";

            if (status == ApprovalStatus.Approved)
                hql = hql + "package.IsApproved = 1 ";
            else if (status == ApprovalStatus.NotApproved)
                hql = hql + "package.IsApproved = 0 ";
            else
                hql = hql + "(package.IsApproved = 1 or package.IsApproved = 0) ";

            if (!String.IsNullOrEmpty(packageType))
                hql = hql + "and package.PackageTypeString = :type ";

            hql = hql + "and (package.Price between :min and :max) ";

            hql = hql + "order by package.Created desc";

            IQuery query = base.NewHqlQuery(hql);
            if (!String.IsNullOrEmpty(packageType))
                query.SetString("type", packageType);

            query.SetDouble("min", min);
            query.SetDouble("max", max);

            return query.List<Package>();
        }
Example #16
0
        public IActionResult GetApprovedThreads(int id, ApprovalStatus approvalStatus)
        {
            var threads = _topicService.FindTopicThreads(id, approvalStatus);

            var dto = _mapper.Map <List <ThreadDto> >(threads.ToList());

            return(Ok(dto));
        }
Example #17
0
        public void ChangeMedicalVendorInvoiceApprovalStatusThrowsExceptionWhenGivenStatusIsInvalid()
        {
            const ApprovalStatus invalidApprovalStatus = 0;

            _mocks.ReplayAll();
            _medicalVendorInvoiceRepository.ChangeMedicalVendorInvoiceApprovalStatus(1, invalidApprovalStatus);
            _mocks.VerifyAll();
        }
Example #18
0
        public List <WorkFlowItem> GetItemsForParent(string type, int Id, ApprovalStatus status, string childtype, int ObjId)
        {
            var items = _repo
                        .Get(x => x.ParentType == type && x.ParentId == Id && x.ApprovalStatus == status && x.Type == childtype) // && x.ObjId == ObjId)
                        .ToList();

            return(items);
        }
Example #19
0
        /// <summary>
        /// Ensures an <see cref="ApprovalStatus"/> is not <see cref="ApprovalStatus.Pending"/>.
        /// </summary>
        public static void EnsureIsNotPending(this ApprovalStatus status)
        {
            var isPending = status.IsPending();

            if (isPending)
            {
                status.ThrowWasStillPendingException();
            }
        }
 public ApprovalDetails(long paymentApprovalStatusHistoryId, ApprovalStatus approvalStatus, int?refuseReasonId,
                        DateTime changed, string setBy)
 {
     PaymentApprovalStatusHistoryId = paymentApprovalStatusHistoryId;
     ApprovalStatus = approvalStatus;
     RefuseReasonId = refuseReasonId;
     Changed        = changed;
     SetBy          = setBy;
 }
Example #21
0
 private void SetApprovalStatus(Thread thread, ApprovalStatus approvalStatus)
 {
     _threadService.SetApprovalStatus(CurrentUserId, thread, approvalStatus);
     _postService.SetApprovalStatus(CurrentUserId, thread.Posts[0], approvalStatus);
     if (approvalStatus == ApprovalStatus.Approved)
     {
         _topicService.IncreaseNumberOfThreads(thread.TopicId);
     }
 }
Example #22
0
        public void Complete()
        {
            if (Status != ApprovalStatus.Pending)
            {
                return;
            }

            Status = ApprovalStatus.Accepted;
            DomainEventBus.Current.Raise(new PromotionApproved(PromotionId));
        }
        public void Complete()
        {
            if (Status != ApprovalStatus.Pending)
            {
                return;
            }

            Status = ApprovalStatus.Accepted;
            DomainEventBus.Current.Raise(new PromotionApproved(PromotionId));
        }
Example #24
0
 private void Clear()
 {
     id = 0;
     dgList.Rows.Clear();
     cmbProject.SelectedIndex = -1;
     cmbBlock.SelectedIndex   = -1;
     cmbApprovalStatus.Text   = "Not Saved";
     EntryApproved            = ApprovalStatus.Pending;
     cmbProject.Enabled       = true;
     cmbBlock.Enabled         = true;
 }
Example #25
0
 public static ProposalDraftAction Add(this IDbSet <ProposalDraftAction> actions, ProposalDraft draft, string type,
                                       ApprovalStatus approvalStatus = ApprovalStatus.None)
 {
     return(actions.Add(new ProposalDraftAction
     {
         DraftId = draft.Id,
         Draft = draft,
         Type = type,
         ApprovalStatus = approvalStatus
     }));
 }
        public async Task <Booking> UpdateBookingStatusAsync(int bookingId, ApprovalStatus newApprovalStatus)
        {
            var booking = await Context.Bookings.FindAsync(bookingId);

            if (booking != null)
            {
                booking.ApprovalStatus = newApprovalStatus;

                await Context.SaveChangesAsync();
            }
            return(booking);
        }
        public void ChangeMedicalVendorInvoiceApprovalStatusChangesStatusOfValidId()
        {
            PhysicianInvoice medicalVendorInvoice = _repository.
                                                    GetMedicalVendorInvoice(VALID_MEDICAL_VENDOR_INVOICE_ID);
            ApprovalStatus newStatus = medicalVendorInvoice.ApprovalStatus == ApprovalStatus.Approved ?
                                       ApprovalStatus.Unapproved : ApprovalStatus.Approved;

            _repository.ChangeMedicalVendorInvoiceApprovalStatus(VALID_MEDICAL_VENDOR_INVOICE_ID, newStatus);
            medicalVendorInvoice = _repository.GetMedicalVendorInvoice(VALID_MEDICAL_VENDOR_INVOICE_ID);

            Assert.AreEqual(newStatus, medicalVendorInvoice.ApprovalStatus);
        }
    protected override IEnumerator OnLoad()
    {
        yield return(base.OnLoad());

        Diagnostics.Assert(base.Empire != null);
        this.departmentOfTheInterior = base.Empire.GetAgency <DepartmentOfTheInterior>();
        Diagnostics.Assert(this.departmentOfTheInterior != null);
        this.departmentOfTheInterior.CitiesCollectionChanged += this.DepartmentOfTheInterior_CitiesCollectionChanged;
        this.departmentOfTheInterior.AssimilatedFactionsCollectionChanged += this.DepartmentOfTheInterior_AssimilatedFactionsCollectionChanged;
        this.departmentOfTheInterior.PopulationRepartitionChanged         += this.DepartmentOfTheInterior_PopulationRepartitionChanged;
        this.departmentOfPlanificationAndDevelopment = base.Empire.GetAgency <DepartmentOfPlanificationAndDevelopment>();
        Diagnostics.Assert(this.departmentOfPlanificationAndDevelopment != null);
        this.departmentOfPlanificationAndDevelopment.BoosterCollectionChange += this.DepartmentOfPlanificationAndDevelopment_BoosterCollectionChange;
        DepartmentOfIndustry departmentOfIndustry = base.Empire.GetAgency <DepartmentOfIndustry>();

        Diagnostics.Assert(departmentOfIndustry != null);
        departmentOfIndustry.AddConstructionChangeEventHandler <CityImprovementDefinition>(new DepartmentOfIndustry.ConstructionChangeEventHandler(this.DepartmentOfIndustry_ConstructionEventHandler));
        departmentOfIndustry.AddConstructionChangeEventHandler <DistrictImprovementDefinition>(new DepartmentOfIndustry.ConstructionChangeEventHandler(this.DepartmentOfIndustry_ConstructionEventHandler));
        departmentOfIndustry.AddConstructionChangeEventHandler <PointOfInterestImprovementDefinition>(new DepartmentOfIndustry.ConstructionChangeEventHandler(this.DepartmentOfIndustry_ConstructionEventHandler));
        IDatabase <ApprovalStatus> approvalStatusDatabase = Databases.GetDatabase <ApprovalStatus>(false);

        if (this.currentEmpireApprovalStatus == null)
        {
            StaticString approvalStatusName = base.Empire.GetDescriptorNameFromType("ApprovalStatus");
            if (!StaticString.IsNullOrEmpty(approvalStatusName) && !approvalStatusDatabase.TryGetValue(approvalStatusName, out this.currentEmpireApprovalStatus))
            {
                Diagnostics.LogWarning("We have found an approval status descriptor on the empire, but the approval status database does not contains it.");
            }
        }
        ReadOnlyCollection <City> cities     = this.departmentOfTheInterior.Cities;
        ApprovalStatus            cityStatus = null;

        for (int index = 0; index < cities.Count; index++)
        {
            if (!this.approvalStatusByGameEntity.ContainsKey(cities[index].GUID))
            {
                StaticString approvalStatusName2 = cities[index].GetDescriptorNameFromType("ApprovalStatus");
                if (!StaticString.IsNullOrEmpty(approvalStatusName2))
                {
                    if (!approvalStatusDatabase.TryGetValue(approvalStatusName2, out cityStatus))
                    {
                        Diagnostics.LogWarning("We have found an approval status descriptor on the empire, but the approval status database does not contains it.");
                    }
                    else
                    {
                        this.approvalStatusByGameEntity.Add(cities[index].GUID, cityStatus);
                    }
                }
            }
        }
        this.RefreshApprovalStatus();
        yield break;
    }
        public tasktClient(string machineName, string userName, string ipAddress, ApprovalStatus approvalStatus)
        {
            id = System.Guid.NewGuid().ToString();
            this.MachineName            = machineName;
            this.UserName               = userName;
            this.IPAddress              = ipAddress;
            this.ApprovalStatus         = approvalStatus;
            this.LastCommunicationEvent = DateTime.Now;
            var generatedKeys = tasktServer.Cryptography.CreateKeyPair();

            PrivateKey = generatedKeys.Item1;
            PublicKey  = generatedKeys.Item2;
        }
 public IHttpActionResult Get(ApprovalStatus status)
 {
     try
     {
         var user = service.GetAllUsers(status);
         return(Content(HttpStatusCode.OK, user));
     }
     catch (Exception e)
     {
         ModelState.AddModelError("", e.Message);
         return(Content(HttpStatusCode.InternalServerError, GetModelStateErrors(ModelState)));
     }
 }
        /// <summary>
        /// Reload the <see cref="TemplateBuildingBlock" /> with the specified <see cref="T:Tridion.ContentManager.CoreService.Client.TemplateBuildingBlockData" />
        /// </summary>
        /// <param name="templateBuildingBlockData"><see cref="T:Tridion.ContentManager.CoreService.Client.TemplateBuildingBlockData" /></param>
        protected void Reload(TemplateBuildingBlockData templateBuildingBlockData)
        {
            if (templateBuildingBlockData == null)
            {
                throw new ArgumentNullException("templateBuildingBlockData");
            }

            mTemplateBuildingBlockData = templateBuildingBlockData;
            base.Reload(templateBuildingBlockData);

            mApprovalStatus = null;
            mWorkflow       = null;
        }
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            ApprovalStatus status = (ApprovalStatus)value;

            switch (status)
            {
            case ApprovalStatus.Approved: return(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#69C6F1")));

            case ApprovalStatus.Rejected: return(new SolidColorBrush(Colors.LightGray));

            default: return(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#074A63")));
            }
        }
 internal static string ConvertToApprovalStatus(ApprovalStatus status)
 {
     switch (status)
     {
         case ApprovalStatus.Approved:
             return "APR";
         case ApprovalStatus.Denied:
             return "DNY";
         case ApprovalStatus.FinalApproved:
             return "FNA";
         case ApprovalStatus.Routed:
             return "RTE";
         default:
             throw new System.InvalidOperationException("Invalid approval status.");
     }
 }
Example #34
0
 public static IProcessAction Create(ApprovalStatus status)
 {
     IProcessAction action = null;
     switch (status)
     {
         case ApprovalStatus.Agree:
             action = new AgreeProcessAction();
             break;
         case ApprovalStatus.Disagree:
             action = new DisagreeProcessAction();
             break;
         case ApprovalStatus.None:
             action = new NextProcessAction();
             break;
     }
     return action;
 }
 private void AddApprovalAudit(ApprovalStatus status, string comments)
 {
     Approval approval = new Approval();
     approval.Status = status;
     approval.ReviewedBy = this.applicationContext.Identity.Name;
     approval.ReviewedOn = DateTime.Now;
     approval.Comments = comments;
     ttrProvider.AddApprovalAudit(this, approval);
 }
        private void CheckCompletion()
        {
            if (Status != ApprovalStatus.Pending)
            {
                return;
            }

            if (ApprovalRequests.Any(r => r.Status == ApprovalStatus.Rejected))
            {
                Status = ApprovalStatus.Rejected;
                DomainEventBus.Current.Raise(new PromotionRejected(PromotionId));
                return;
            }

            if(ApprovalRequests.Count(r => r.Status == ApprovalStatus.Accepted) >= 2)
            {
                Status = ApprovalStatus.Accepted;
                DomainEventBus.Current.Raise(new PromotionApproved(PromotionId));
            }
        }
 public void Approve()
 {
     Status = ApprovalStatus.Accepted;
 }
 public void Reject(string comment)
 {
     Comment = comment;
     Status = ApprovalStatus.Rejected;
 }