Beispiel #1
0
        protected void btnPnlCancelWO_Click(object sender, EventArgs e)
        {
            PRMWorkOrderEntity pRMWorkOrderEntity = FCCPRMWorkOrder.GetFacadeCreate().GetByID(PRMWorkOrderID);

            pRMWorkOrderEntity.WorkOrderStatusID = MasterDataConstants.WorkOrderStatus.CANCELED;
            pRMWorkOrderEntity.Remarks           = txtWOCancelRemarks.Text.Trim().ToString();

            Int64  result = -1;
            String fe     = SqlExpressionBuilder.PrepareFilterExpression(PRMWorkOrderEntity.FLD_NAME_WorkOrderID, PRMWorkOrderID.ToString(), SQLMatchType.Equal);

            result = FCCPRMWorkOrder.GetFacadeCreate().Update(pRMWorkOrderEntity, fe, DatabaseOperationType.Update, TransactionRequired.No);

            if (result > 0)
            {
                #region AP Update

                APApprovalProcessEntity aPApprovalProcessEntity = FCCAPApprovalProcess.GetFacadeCreate().GetByID(APApprovalProcessID);

                if (aPApprovalProcessEntity != null && aPApprovalProcessEntity.APApprovalProcessID > 0)
                {
                    aPApprovalProcessEntity.APStatusID = MasterDataConstants.APStatus.CANCELED;

                    Int64 resultOne = -1;

                    String fe_one = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, APApprovalProcessID.ToString(), SQLMatchType.Equal);
                    resultOne = FCCAPApprovalProcess.GetFacadeCreate().Update(aPApprovalProcessEntity, fe_one, DatabaseOperationType.Update, TransactionRequired.No);

                    if (resultOne > 0)
                    {
                        APMemberFeedbackEntity aPMemberFeedbackEntity = FCCAPMemberFeedback.GetFacadeCreate().GetByID(APMemberFeedbackID);

                        if (aPMemberFeedbackEntity != null && aPMemberFeedbackEntity.APMemberFeedbackID > 0)
                        {
                            aPMemberFeedbackEntity.APFeedbackID = MasterDataConstants.APFeedback.CANCELED;

                            Int64  resultC           = -1;
                            String fe_memberfeedback = SqlExpressionBuilder.PrepareFilterExpression(APMemberFeedbackEntity.FLD_NAME_APMemberFeedbackID, APMemberFeedbackID.ToString(), SQLMatchType.Equal);

                            resultC = FCCAPMemberFeedback.GetFacadeCreate().Update(aPMemberFeedbackEntity, fe_memberfeedback, DatabaseOperationType.Update, TransactionRequired.No);

                            RedirectPageToPendingList();
                        }
                    }
                }

                #endregion
            }
        }
Beispiel #2
0
        protected void lvAPApprovalProcess_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 APApprovalProcessID;

            Int64.TryParse(e.CommandArgument.ToString(), out APApprovalProcessID);

            if (APApprovalProcessID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _APApprovalProcessID = APApprovalProcessID;

                    PrepareEditView();

                    cpeEditor.Collapsed   = false;
                    cpeEditor.ClientState = "false";
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(APApprovalProcessEntity.FLD_NAME_APApprovalProcessID, APApprovalProcessID.ToString(), SQLMatchType.Equal);

                        APApprovalProcessEntity aPApprovalProcessEntity = new APApprovalProcessEntity();


                        result = FCCAPApprovalProcess.GetFacadeCreate().Delete(aPApprovalProcessEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _APApprovalProcessID     = 0;
                            _APApprovalProcessEntity = new APApprovalProcessEntity();
                            PrepareInitialView();
                            BindAPApprovalProcessList();

                            MiscUtil.ShowMessage(lblMessage, "A PApproval Process has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete A PApproval Process.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }