コード例 #1
0
        /// <summary>
        /// Retrieve unpaid details debt summary information list of specific screen mode and search criteria information
        /// </summary>
        /// <param name="data">Search criteria</param>
        /// <returns></returns>
        public ActionResult ICS032_SearchData(ICS032_RegisterData data)
        {
            ICS032_ScreenParameter param        = GetScreenObject <ICS032_ScreenParameter>();
            ICS032_RegisterData    RegisterData = new ICS032_RegisterData();
            CommonUtil             comUtil      = new CommonUtil();

            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
            string strMemoBillingTargetCode = string.Empty;
            string strMemoInvoiceNo         = string.Empty;
            int    intMemo = 0;

            try
            {
                // Common Check Sequence

                // System Suspend
                ICommonHandler handlerCommon  = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                IIncomeHandler iincomeHandler = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler;

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

                // Check User Permission

                //if (!CheckUserPermission(ScreenID.C_SCREEN_ID_MONEY_COLLECTION_MANAGEMENT_INFO, FunctionID.C_FUNC_ID_OPERATE) )
                //{
                //    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0053);
                //    return Json(res);
                //}


                res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;

                //Add by budd, support multi-language
                IOfficeMasterHandler masterHandler = ServiceContainer.GetService <IOfficeMasterHandler>() as IOfficeMasterHandler;
                List <tbm_Office>    doTbm_Office  = masterHandler.GetTbm_Office(param.strBillingOfficeCode);

                if (doTbm_Office != null && doTbm_Office.Count > 0)
                {
                    CommonUtil.MappingObjectLanguage <tbm_Office>(doTbm_Office);
                    param.strBillingOfficeName = doTbm_Office[0].OfficeName;
                }



                // load GetBillingCodeDeptSummary
                if (param.doGetUnpaidDetailDebtSummaryByBillingCodeList != null)
                {
                    if (param.doGetUnpaidDetailDebtSummaryByBillingCodeList.Count != 0)
                    {
                        param.doGetBillingCodeDebtSummaryList = iincomeHandler.GetBillingCodeDebtSummaryList(
                            param.doGetUnpaidDetailDebtSummaryByBillingCodeList[0].BillingCode);
                    }
                }
                // load GetDebtTracingMemo
                if (param.doBillingTargetDebtSummaryList != null)
                {
                    if (param.doBillingTargetDebtSummaryList.Count != 0)
                    {
                        strMemoBillingTargetCode = param.doBillingTargetDebtSummaryList[0].BillingTargetCode;
                    }
                }

                if (param.doGetUnpaidInvoiceDebtSummaryByBillingTargetList != null)
                {
                    if (param.doGetUnpaidInvoiceDebtSummaryByBillingTargetList.Count != 0)
                    {
                        strMemoInvoiceNo = param.doGetUnpaidInvoiceDebtSummaryByBillingTargetList[0].InvoiceNo;
                        intMemo          = param.doGetUnpaidInvoiceDebtSummaryByBillingTargetList[0].InvoiceOCC;
                    }
                }


                param.doGetDebtTracingMemoList = iincomeHandler.GetDebtTracingMemoList(
                    strMemoBillingTargetCode,
                    strMemoInvoiceNo,
                    intMemo);

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

                return(Json(res));
            }
            catch (Exception ex)
            {
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                res.AddErrorMessage(ex);
            }

            return(Json(res));
        }