예제 #1
0
        public ActionResult ICR010_GenerateReport(string receiptNo)
        {
            ObjectResultData       res              = new ObjectResultData();
            IIncomeHandler         incomeHandler    = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;
            IIncomeDocumentHandler incomeDocHandler = ServiceContainer.GetService <IIncomeDocumentHandler>() as IIncomeDocumentHandler;

            try
            {
                doReceipt receiptData = incomeHandler.GetReceipt(receiptNo);
                if (receiptData != null)
                {
                    incomeDocHandler.GenerateICR010FilePath(receiptData.ReceiptNo, receiptData.CreateBy, receiptData.CreateDate.Value);
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }
예제 #2
0
        /// <summary>
        /// Retrieve receipt information of specific screen mode and search criteria information
        /// </summary>
        /// <param name="data">Search criteria</param>
        /// <returns></returns>
        public ActionResult ICS100_RetrieveData(ICS100_RegisterData data)
        {
            ICS100_ScreenParameter param        = GetScreenObject <ICS100_ScreenParameter>();
            ICS100_RegisterData    RegisterData = new ICS100_RegisterData();
            CommonUtil             comUtil      = new CommonUtil();

            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;

            ValidatorUtil validator = new ValidatorUtil();

            try
            {
                IIncomeHandler incomeHandler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;
                ICommonHandler handlerCommon = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

                doReceipt _doReceipt = new doReceipt();
                List <tbt_MoneyCollectionInfo> _dotbt_MoneyCollectionInfoList = new List <tbt_MoneyCollectionInfo>();

                // Check System Suspend
                if (handlerCommon.IsSystemSuspending())
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0049);
                    return(Json(res));
                }

                res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
                ICS100_ScreenParameter sParam = GetScreenObject <ICS100_ScreenParameter>();

                if (data == null)
                {
                    validator.AddErrorMessage(MessageUtil.MODULE_INCOME,
                                              "ICS100",
                                              MessageUtil.MODULE_COMMON,
                                              MessageUtil.MessageList.MSG0007,
                                              "txtReceiptNo", "lblReceiptNo", "txtReceiptNo");
                }
                if (data.Header == null)
                {
                    validator.AddErrorMessage(MessageUtil.MODULE_INCOME,
                                              "ICS100",
                                              MessageUtil.MODULE_COMMON,
                                              MessageUtil.MessageList.MSG0007,
                                              "txtReceiptNo", "lblReceiptNo", "txtReceiptNo");
                }

                /////////////////////////////////////////////////////////////////////
                if (String.IsNullOrEmpty(data.Header.txtReceiptNo))
                {
                    validator.AddErrorMessage(MessageUtil.MODULE_INCOME,
                                              "ICS100",
                                              MessageUtil.MODULE_COMMON,
                                              MessageUtil.MessageList.MSG0007,
                                              "txtReceiptNo", "lblReceiptNo", "txtReceiptNo");
                }

                ValidatorUtil.BuildErrorMessage(res, validator, null);
                if (res.IsError)
                {
                    return(Json(res));
                }
                //--------------------------------------------------------------

                param._dotbt_MoneyCollectionInfo = null;
                param.doReceipt = null;

                _doReceipt = incomeHandler.GetReceipt(data.Header.txtReceiptNo);
                if (_doReceipt == null)
                {
                    //MSG7003
                    res.AddErrorMessage(MessageUtil.MODULE_INCOME,
                                        "ICS100",
                                        MessageUtil.MODULE_INCOME,
                                        MessageUtil.MessageList.MSG7003,
                                        new string[] { "lblReceiptNo" },
                                        new string[] { "txtReceiptNo" });
                    res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                    return(Json(res));
                }
                else
                {
                    if (_doReceipt.AdvanceReceiptStatus != AdvanceReceiptStatus.C_INC_ADVANCE_RECEIPT_STATUS_ISSUED)
                    {
                        //MSG7028
                        res.AddErrorMessage(MessageUtil.MODULE_INCOME,
                                            "ICS100",
                                            MessageUtil.MODULE_INCOME,
                                            MessageUtil.MessageList.MSG7028,
                                            new string[] { data.Header.txtReceiptNo },
                                            new string[] { "txtReceiptNo" });
                        return(Json(res));
                    }
                    _dotbt_MoneyCollectionInfoList = incomeHandler.GetTbt_MoneyCollectionInfo(data.Header.txtReceiptNo);
                }
                if (_dotbt_MoneyCollectionInfoList != null)
                {
                    if (_dotbt_MoneyCollectionInfoList.Count > 0)
                    {
                        param._dotbt_MoneyCollectionInfo = _dotbt_MoneyCollectionInfoList[0];
                    }
                }

                param.doReceipt = _doReceipt;

                // return "1" to js is every thing OK
                if (res.MessageList == null || res.MessageList.Count == 0)
                {
                    res.ResultData = sParam;
                }
                else
                {
                    res.ResultData = null;
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }