Пример #1
0
        /// <summary>
        /// Get Rental Basic information from tbt_RentalBasic
        /// </summary>
        /// <param name="strLongContratCode"></param>
        /// <returns></returns>
        public dsRentalBasicForHistDigestView GetRentalBasicForHistoryDigestView(string strLongContratCode)
        {
            try
            {
                dsRentalBasicForHistDigestView          dsRentBasicForHDView = new dsRentalBasicForHistDigestView();
                IRentralContractHandler                 handRen = ServiceContainer.GetService <IRentralContractHandler>() as IRentralContractHandler;
                List <dtTbt_RentalContractBasicForView> lstTbt_RentalContractBasicForView = handRen.GetTbt_RentalContractBasicForView(strLongContratCode);
                if (lstTbt_RentalContractBasicForView.Count <= 0)
                {
                    throw ApplicationErrorException.ThrowErrorException(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0001);
                }
                dsRentBasicForHDView.dtTbt_RentalContractBasicForView = lstTbt_RentalContractBasicForView;

                //2.3
                ICommonHandler handCom = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                //List<doMiscTypeCode> MiscTypeCode = new List<doMiscTypeCode>();
                //for (int i = 0; i < 3; i++)
                //    MiscTypeCode.Add(new doMiscTypeCode());

                //MiscTypeCode[0].FieldName = MiscType.C_RENTAL_CHANGE_TYPE;
                //MiscTypeCode[0].ValueCode = "%";
                //MiscTypeCode[1].FieldName = MiscType.C_INCIDENT_TYPE;
                //MiscTypeCode[1].ValueCode = "%";
                //MiscTypeCode[2].FieldName = MiscType.C_AR_TYPE;
                //MiscTypeCode[2].ValueCode = "%";

                //List<doMiscTypeCode> MiscTypeResult = handCom.GetMiscTypeCodeList(MiscTypeCode);
                //dsRentBasicForHDView.dtMiscellaneousType = MiscTypeResult;

                IViewContractHandler  handView      = ServiceContainer.GetService <IViewContractHandler>() as IViewContractHandler;
                ICommonHandler        comHand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> tmpCurrencies = comHand.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                }).ToList();

                List <dtRentalHistoryDigest> dtRentalHistoryDigest = handView.GetRentalHistoryDigestList(dsRentBasicForHDView.dtTbt_RentalContractBasicForView[0].ContractCode, null, null);

                for (int i = 0; i < dtRentalHistoryDigest.Count; i++)
                {
                    dtRentalHistoryDigest[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                }

                dsRentBasicForHDView.dtRentalHistoryDigest = dtRentalHistoryDigest;
                return(dsRentBasicForHDView);
            }
            catch (Exception) { throw; }
        }
Пример #2
0
        /// <summary>
        /// Get Rental digest by type and contract code.
        /// </summary>
        /// <param name="sType"></param>
        /// <param name="strLongContractCode"></param>
        /// <returns></returns>
        public ActionResult getRentalDigestCMS150(string sType, string strLongContractCode)
        {
            if (strLongContractCode.Trim() == "")
            {
                strLongContractCode = null;
            }
            if (sType.Trim() == "")
            {
                sType = null;
            }


            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
            List <View_dtRentalHistoryDigest> RentalHist = null;

            try
            {
                IRentralContractHandler handRen = ServiceContainer.GetService <IRentralContractHandler>() as IRentralContractHandler;
                List <dtTbt_RentalContractBasicForView> lstTbt_RentalContractBasicForView = handRen.GetTbt_RentalContractBasicForView(strLongContractCode);
                if (lstTbt_RentalContractBasicForView.Count <= 0)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0001);
                    // return Json(res);
                }
                else
                {
                    IViewContractHandler         handView = ServiceContainer.GetService <IViewContractHandler>() as IViewContractHandler;
                    List <dtRentalHistoryDigest> dtRentalHistoryDigest = handView.GetRentalHistoryDigestList(lstTbt_RentalContractBasicForView[0].ContractCode, null, null);
                    RentalHist = CommonUtil.ConvertObjectbyLanguage <dtRentalHistoryDigest, View_dtRentalHistoryDigest>(dtRentalHistoryDigest, "ChangeTypeName", "IncidentARTypeName", "DocAuditResultName", "DocumentName");
                }
                res.ResultData = CommonUtil.ConvertToXml <View_dtRentalHistoryDigest>(RentalHist, "Common\\CMS150", CommonUtil.GRID_EMPTY_TYPE.SEARCH);
                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }