/// <summary> /// Get billing detail for combine /// </summary> /// <returns></returns> public ActionResult BLS071_GetBillingDetailForCombine() { ObjectResultData res = new ObjectResultData(); BLS071_ScreenParameter param = GetScreenObject <BLS071_ScreenParameter>(); try { List <BLS071_BillingDetail> doBillingDetail = new List <BLS071_BillingDetail>(); IBillingHandler handler = ServiceContainer.GetService <IBillingHandler>() as IBillingHandler; CommonUtil cm = new CommonUtil(); if (param.dtOldBillingDetailList.Count > 0) { string strBillingTargetCode_long = cm.ConvertBillingTargetCode(param.doBillingTarget.BillingTargetCode, CommonUtil.CONVERT_TYPE.TO_LONG); string strBillingTypeCode = param.dtOldBillingDetailList[0].BillingTypeCode; List <doBillingDetail> doBillingDetailForCombineList = handler.GetBillingDetailForCombine(strBillingTargetCode_long, strBillingTypeCode, CurrencyUtil.C_CURRENCY_LOCAL, CurrencyUtil.C_CURRENCY_US, param.currencyCode); List <doMiscTypeCode> lst = new List <doMiscTypeCode>(); ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler; lst = hand.GetMiscTypeCodeList(new List <doMiscTypeCode>() { new doMiscTypeCode() { FieldName = MiscType.C_CURRENCT, ValueCode = "%" } }).ToList(); foreach (var d in doBillingDetailForCombineList) { if (string.IsNullOrEmpty(d.BillingAmountCurrencyType)) { d.BillingAmountCurrencyType = "1"; } if (d.BillingAmountCurrencyType == SECOM_AJIS.Common.Util.ConstantValue.CurrencyUtil.C_CURRENCY_US) { d.BillingAmount = d.BillingAmountUsd; } if (d.BillingAmount == null) { d.BillingAmount = 0; } d.BillingAmountCurrencyTypeName = lst.Where(m => m.ValueCode == d.BillingAmountCurrencyType).Select(m => m.ValueDisplayEN).FirstOrDefault(); } doBillingDetail = CommonUtil.ClonsObjectList <doBillingDetail, BLS071_BillingDetail>(doBillingDetailForCombineList); } param.doBillingDetailForCombineList = doBillingDetail; res.ResultData = CommonUtil.ConvertToXml <BLS071_BillingDetail>(doBillingDetail, "Billing\\BLS071_BillingDetail", CommonUtil.GRID_EMPTY_TYPE.VIEW); } catch (Exception ex) { res.AddErrorMessage(ex); } return(Json(res)); }