示例#1
0
        /// <summary>
        /// Get rental contract basic information to show in user control
        /// </summary>
        /// <param name="strContrancCode"></param>
        /// <returns></returns>
        public doRentalContractBasicInformation GetRentalContactBasicInformationData(string strContractCode)
        {
            try
            {
                string installStatus = "";
                doRentalContractBasicInformation doRentalContract = new doRentalContractBasicInformation();
                doRentalContract.ContractCode = strContractCode;
                CommonUtil.CheckMandatoryFiled(doRentalContract);

                List <doRentalContractBasicInformation> doRentalContractBasicInformation = base.GetRentalContractBasicInformation(strContractCode);
                ICommonHandler        common           = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                IInstallationHandler  installhandler   = ServiceContainer.GetService <IInstallationHandler>() as IInstallationHandler;
                List <doMiscTypeCode> lMiscTypeCode    = new List <doMiscTypeCode>();
                List <doMiscTypeCode> viewMiscTypeCode = new List <doMiscTypeCode>();

                doMiscTypeCode dMiscTypeCode = new doMiscTypeCode();

                installStatus = installhandler.GetInstallationStatus(strContractCode);

                dMiscTypeCode.FieldName = SECOM_AJIS.Common.Util.ConstantValue.MiscType.C_INSTALL_STATUS;
                //dMiscTypeCode.ValueCode = "99"; //I will set default to 00 because the table installation still not create.
                dMiscTypeCode.ValueCode = installStatus;


                lMiscTypeCode.Add(dMiscTypeCode);
                lMiscTypeCode = common.GetMiscTypeCodeList(lMiscTypeCode);

                viewMiscTypeCode = common.GetMiscTypeCodeList(lMiscTypeCode);

                if (doRentalContractBasicInformation.Count != 0)
                {
                    if (viewMiscTypeCode != null && viewMiscTypeCode.Count > 0)
                    {
                        doRentalContractBasicInformation[0].InstallationStatusCode = installStatus;
                        doRentalContractBasicInformation[0].InstallationStatusName = viewMiscTypeCode[0].ValueDisplay;
                    }

                    //List<doRentalContractBasicInformation> list = doRentalContractBasicInformation;
                    //CommonUtil.MappingObjectLanguage<doRentalContractBasicInformation>(list);
                    //doRentalContractBasicInformation[0].OperationOfficeName = list[0].OperationOfficeName;
                    CommonUtil.MappingObjectLanguage <doRentalContractBasicInformation>(doRentalContractBasicInformation);

                    MiscTypeMappingList miscList = new MiscTypeMappingList();
                    miscList.AddMiscType(doRentalContractBasicInformation[0]);

                    ICommonHandler comHandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                    comHandler.MiscTypeMappingList(miscList);

                    return(doRentalContractBasicInformation[0]);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
示例#2
0
        /// <summary>
        /// Generate correction reason comboitem list upon payment status of specific invoice no.
        /// </summary>
        /// <param name="paymentStatus">payment status</param>
        /// <returns></returns>
        public ActionResult ICS090_GetCorrectionReason(string paymentStatus)
        {
            try
            {
                //Get misc type
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CORRECTION_REASON,
                        ValueCode = "%"
                    }
                };
                ICommonHandler        commonHandler  = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> correctionList = new List <doMiscTypeCode>();
                if (paymentStatus == PaymentStatus.C_PAYMENT_STATUS_BANK_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_AUTO_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_CASH_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_CHEQUE_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_CASHIER_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_AUTO_FAIL_BANK_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_NOTE_FAIL_BANK_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_POST_FAIL_BANK_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PARTIALLY_PAID ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PAID_WITH_PARTIAL_CN ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PARTIALLY_PAID_CN ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_PAID_WITH_PARTIAL_REFUND ||
                    paymentStatus == PaymentStatus.C_PAYMENT_STATUS_REFUND_PAID)
                {
                    correctionList = commonHandler.GetMiscTypeCodeList(miscs).Where(d => d.ValueCode == CorrectionReason.C_CORRECTION_REASON_MISTAKE).ToList();
                }
                else if (paymentStatus == PaymentStatus.C_PAYMENT_STATUS_NOTE_MATCHED ||
                         paymentStatus == PaymentStatus.C_PAYMENT_STATUS_POST_MATCHED)
                {
                    //All, Except encash
                    correctionList = commonHandler.GetMiscTypeCodeList(miscs).Where(d => d.ValueCode != CorrectionReason.C_CORRECTION_REASON_ENCASH_MISTAKE).ToList();
                }
                else if (paymentStatus == PaymentStatus.C_PAYMENT_STATUS_NOTE_ENCASHED ||
                         paymentStatus == PaymentStatus.C_PAYMENT_STATUS_POST_ENCASHED)
                {
                    //Encash only
                    correctionList = commonHandler.GetMiscTypeCodeList(miscs).Where(d => d.ValueCode == CorrectionReason.C_CORRECTION_REASON_ENCASH_MISTAKE).ToList();
                }

                //Set correction reason combobox
                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(correctionList, "ValueDisplay", "ValueCode");

                //Success, return result
                return(Json(cboModel));
            }
            catch (Exception ex)
            {
                ObjectResultData res = new ObjectResultData();
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
示例#3
0
        public ActionResult ISS080_GetAllInstallationtype(string strFieldName)
        {
            string strDisplayName      = "ValueCodeDisplay";
            List <doMiscTypeCode> lst  = new List <doMiscTypeCode>();
            List <doMiscTypeCode> lst2 = new List <doMiscTypeCode>();

            try
            {
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = "RentalInstallationType",
                        ValueCode = "%"
                    }
                };

                ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                lst = hand.GetMiscTypeCodeList(miscs);

                miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = "SaleInstallationType",
                        ValueCode = "%"
                    }
                };
                lst2 = hand.GetMiscTypeCodeList(miscs);

                foreach (doMiscTypeCode dtl in lst2)
                {
                    lst.Add(dtl);
                }


                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(lst, "ValueCodeDisplay", "ValueCode");

                return(Json(cboModel));
            }
            catch (Exception ex)
            {
                ObjectResultData res = new ObjectResultData();
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
        public ActionResult MAS110()
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                ViewBag.HasPermissionAdd    = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_SUBCONTRACTOR_INFO, FunctionID.C_FUNC_ID_ADD);
                ViewBag.HasPermissionEdit   = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_SUBCONTRACTOR_INFO, FunctionID.C_FUNC_ID_EDIT);
                ViewBag.HasPermissionDelete = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_SUBCONTRACTOR_INFO, FunctionID.C_FUNC_ID_DEL);

                //Get misc type
                ICommonHandler        commonHandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> doFlagDisplay = commonHandler.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_FLAG_DISPLAY,
                        ValueCode = "%"
                    }
                });
                ViewBag.FlagDisplayYes = doFlagDisplay.Where(d => d.ValueCode == FlagDisplay.C_FLAG_DISPLAY_YES).First().ValueDisplay;
                ViewBag.FlagDisplayNo  = doFlagDisplay.Where(d => d.ValueCode == FlagDisplay.C_FLAG_DISPLAY_NO).First().ValueDisplay;
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
            return(View());
        }
        public static string getCurrencyFullName(string currencyCode, string defaultValue = "-", bool isThrowException = false)
        {
            try
            {
                List <doMiscTypeCode> lst   = new List <doMiscTypeCode>();
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                };

                ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                lst = hand.GetMiscTypeCodeList(miscs).ToList();

                return(lst.Where(m => m.ValueCode == currencyCode).Select(m => m.ValueDescription).First());
            }
            catch (Exception ex)
            {
                if (isThrowException)
                {
                    throw ex;
                }
                else
                {
                    return(defaultValue);
                }
            }
        }
        public static string convertNameToCode(string curencyName, bool isThrowException = false, string defaultValue = "1", List <doMiscTypeCode> currencyDatas = null)
        {
            try
            {
                if (currencyDatas == null)
                {
                    currencyDatas = new List <doMiscTypeCode>();
                    List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                    {
                        new doMiscTypeCode()
                        {
                            FieldName = MiscType.C_CURRENCT,
                            ValueCode = "%"
                        }
                    };

                    ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                    currencyDatas = hand.GetMiscTypeCodeList(miscs).ToList();
                }


                return(currencyDatas.Where(m => m.ValueDisplayEN == curencyName).Select(m => m.ValueCode).First());
            }
            catch (Exception ex)
            {
                if (isThrowException)
                {
                    throw ex;
                }
                else
                {
                    return(defaultValue);
                }
            }
        }
示例#7
0
        public static MvcHtmlString OperationTypeCheckList(this HtmlHelper helper,
                                                           string id,
                                                           string[] check_val = null,
                                                           object attribute   = null)
        {
            List <doMiscTypeCode> lst = new List <doMiscTypeCode>();

            try
            {
                ICommonHandler handler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                if (handler != null)
                {
                    lst = handler.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                    {
                        new doMiscTypeCode()
                        {
                            FieldName = SECOM_AJIS.Common.Util.ConstantValue.MiscType.C_OPERATION_TYPE,
                            ValueCode = "%"
                        }
                    });
                }
            }
            catch
            {
            }

            return(CommonUtil.CommonCheckButtonList <doMiscTypeCode>(id, null, lst, "ValueCodeDisplay", "ValueCode", false, check_val, attribute));
        }
        /// <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));
        }
        public ActionResult ICS030()
        {
            ICS030_ScreenParameter param = GetScreenObject <ICS030_ScreenParameter>();
            List <doMiscTypeCode>  lst   = new List <doMiscTypeCode>();

            if (param != null)
            {
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_FLAG_DISPLAY,
                        ValueCode = "%"
                    }
                };

                ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                lst = hand.GetMiscTypeCodeList(miscs);

                foreach (doMiscTypeCode l in lst)
                {
                    if (l.ValueCode == FlagDisplay.C_FLAG_DISPLAY_NO)
                    {
                        param.conNo = l.ValueDisplay;
                    }
                    if (l.ValueCode == FlagDisplay.C_FLAG_DISPLAY_YES)
                    {
                        param.conYes = l.ValueDisplay;
                    }
                }
            }
            return(View());
        }
示例#10
0
        /// <summary>
        /// Load ChangeType by selected serviceType.
        /// </summary>
        /// <param name="serviceType"></param>
        /// <returns></returns>
        public ActionResult ListMiscChangeType(string serviceType)
        {
            ICommonHandler        handCom      = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <doMiscTypeCode> MiscTypeCode = new List <doMiscTypeCode>();

            MiscTypeCode.Add(new doMiscTypeCode());

            if (serviceType == ServiceType.C_SERVICE_TYPE_RENTAL)
            {
                MiscTypeCode[0].FieldName = MiscType.C_RENTAL_CHANGE_TYPE;
            }
            else
            {
                MiscTypeCode[0].FieldName = MiscType.C_SALE_CHANGE_TYPE;
            }

            MiscTypeCode[0].ValueCode = "%";

            List <doMiscTypeCode> MiscTypeResult = handCom.GetMiscTypeCodeList(MiscTypeCode);
            ComboBoxModel         CbxModel       = new ComboBoxModel();

            CbxModel.SetList <doMiscTypeCode>(MiscTypeResult, "ValueCodeDisplay", "ValueCode", false);

            return(Json(CbxModel));
        }
示例#11
0
        /// <summary>
        /// Get customer group summary data
        /// </summary>
        /// <returns></returns>
        public ActionResult CMS100_LoadGroupSummary()
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CMS100_ScreenParameter CMS100Param   = GetScreenObject <CMS100_ScreenParameter>();
                IViewContractHandler   hand          = 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 <dtGroupSummaryForShow> lst = hand.GetGroupSummaryForViewCustGrpData(CMS100Param.GroupCode);

                res.ResultData = CommonUtil.ConvertToXml <dtGroupSummaryForShow>(lst, "Common\\CMS100_Gsum", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }
            return(Json(res));
        }
示例#12
0
        /// <summary>
        /// Get Sale digest by type, contract code and OCC.
        /// </summary>
        /// <param name="sType"></param>
        /// <param name="strLongContractCode"></param>
        /// <param name="OCC"></param>
        /// <returns></returns>
        public ActionResult getSaleDigestCMS150(string sType, string strLongContractCode, string OCC)
        {
            if (OCC.Trim() == "")
            {
                OCC = null;
            }
            if (strLongContractCode.Trim() == "")
            {
                strLongContractCode = null;
            }
            if (sType.Trim() == "")
            {
                sType = null;
            }

            List <View_dtSaleHistoryDigestList> vSaleHist = null;
            ObjectResultData res = new ObjectResultData();

            try
            {
                ISaleContractHandler  handSale      = ServiceContainer.GetService <ISaleContractHandler>() as ISaleContractHandler;
                ICommonHandler        comHand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> tmpCurrencies = comHand.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                }).ToList();
                List <dtTbt_SaleBasicForView> dtTbt_SaleBasicForView = handSale.GetTbt_SaleBasicForView(strLongContractCode, OCC, FlagType.C_FLAG_ON);
                //Add Currency to List
                for (int i = 0; i < dtTbt_SaleBasicForView.Count(); i++)
                {
                    dtTbt_SaleBasicForView[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                }

                if (dtTbt_SaleBasicForView.Count <= 0)
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0001);
                    // return Json(res);
                }
                else
                {
                    IViewContractHandler       handView            = ServiceContainer.GetService <IViewContractHandler>() as IViewContractHandler;
                    List <dtSaleHistoryDigest> dtSaleHistoryDigest = handView.GetSaleHistoryDigestList(dtTbt_SaleBasicForView[0].ContractCode, null, null);
                    //Add Currency to List
                    for (int i = 0; i < dtSaleHistoryDigest.Count(); i++)
                    {
                        dtSaleHistoryDigest[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                    }
                    vSaleHist = CommonUtil.ConvertObjectbyLanguage <dtSaleHistoryDigest, View_dtSaleHistoryDigestList>(dtSaleHistoryDigest, "ChangeTypeName", "IncidentARTypeName");
                }

                string XmlSaleHist = CommonUtil.ConvertToXml <View_dtSaleHistoryDigestList>(vSaleHist, "Common\\CMS150_sale", CommonUtil.GRID_EMPTY_TYPE.SEARCH);
                return(Json(XmlSaleHist));
            }
            catch (Exception ex) { res.AddErrorMessage(ex); return(Json(res)); }
        }
示例#13
0
        private ActionResult GetChangeTypeFirstElementAllCombo(string filter)
        {
            try
            {
                string         strDisplay = "ValueDisplay";
                ICommonHandler hand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>();
                if (filter == null || MiscType.C_ALL_CHANGE_TYPE.Equals(filter))
                {
                    miscs.Add(
                        new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_RENTAL_CHANGE_TYPE,
                        ValueCode = "%"
                    });
                    miscs.Add(
                        new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_SALE_CHANGE_TYPE,
                        ValueCode = "%"
                    });
                }
                else
                {
                    miscs.Add(
                        new doMiscTypeCode()
                    {
                        FieldName = filter,
                        ValueCode = "%"
                    });
                }

                List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(miscs);

                foreach (doMiscTypeCode i in MiscLock)
                {
                    i.ValueDisplay = i.ValueCode + ':' + i.ValueDisplay;
                }

                //MessageModel select = MessageUtil.GetMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0113);
                string strSelect = CommonUtil.GetLabelFromResource("Common", "CMS030", "lblComboboxSelect");

                //doMiscTypeCode first = new doMiscTypeCode();
                //first.ValueCode = "";
                //first.ValueDisplay = strSelect;
                //MiscLock.Insert(0, first);

                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(MiscLock, strDisplay, "ValueCode", true, CommonUtil.eFirstElementType.All);

                return(Json(cboModel));
            }
            catch (Exception ex)
            {
                // return Json(MessageUtil.GetMessage(ex));
                return(null);
            }
        }
        /// <summary>
        /// Get Pre-elimination Location for combobox.
        /// </summary>
        /// <param name="SourceLoc"></param>
        /// <returns></returns>
        public ActionResult IVS040_GetPreEliminationLocationCbo(string SourceLoc)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                ICommonHandler        comh   = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> dtMisc = new List <doMiscTypeCode>();

                if (SourceLoc == InstrumentLocation.C_INV_LOC_INSTOCK || SourceLoc == InstrumentLocation.C_INV_LOC_RETURNED)
                {
                    doMiscTypeCode misc = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_PRE_ELIMINATION;
                    dtMisc.Add(misc);
                }
                else if (SourceLoc == InstrumentLocation.C_INV_LOC_PRE_ELIMINATION)
                {
                    doMiscTypeCode misc = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_INSTOCK;
                    dtMisc.Add(misc);
                    misc           = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_RETURNED;
                    dtMisc.Add(misc);
                }
                else
                {
                    doMiscTypeCode misc = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_INSTOCK;
                    dtMisc.Add(misc);
                    misc           = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_RETURNED;
                    dtMisc.Add(misc);
                    misc           = new doMiscTypeCode();
                    misc.FieldName = MiscType.C_INV_LOC;
                    misc.ValueCode = InstrumentLocation.C_INV_LOC_PRE_ELIMINATION;
                    dtMisc.Add(misc);
                }

                List <doMiscTypeCode> ResMisc = new List <doMiscTypeCode>();

                ResMisc = comh.GetMiscTypeCodeList(dtMisc);

                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(ResMisc, "ValueCodeDisplay", "ValueCode");
                res.ResultData = cboModel;

                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex); return(Json(res));
            }
        }
示例#15
0
        /// <summary>
        /// Get billing detail list
        /// </summary>
        /// <returns></returns>
        public ActionResult CMS450_ViewBillingDetailList()
        {
            ObjectResultData res = new ObjectResultData();
            List <dtViewBillingDetailList> list = new List <dtViewBillingDetailList>();

            try
            {
                CMS450_ScreenParameter param             = GetScreenObject <CMS450_ScreenParameter>();
                CommonUtil             cm                = new CommonUtil();
                string strContractCode                   = cm.ConvertContractCode(param.ContractCode, CommonUtil.CONVERT_TYPE.TO_LONG);
                IViewBillingHandler   handlerViewBilling = ServiceContainer.GetService <IViewBillingHandler>() as IViewBillingHandler;
                ICommonHandler        comHand            = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> tmpCurrencies      = comHand.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                }).ToList();

                if (!CommonUtil.IsNullOrEmpty(param.BillingTargetCode))
                {
                    list = handlerViewBilling.GetViewBillingDetailListByTargetCode(cm.ConvertBillingTargetCode(param.BillingTargetCode, CommonUtil.CONVERT_TYPE.TO_LONG));
                }
                else if (!CommonUtil.IsNullOrEmpty(param.BillingOCC) && !CommonUtil.IsNullOrEmpty(param.ContractCode))
                {
                    list = handlerViewBilling.GetViewBillingDetailList(strContractCode, param.BillingOCC);
                }
                else if (!CommonUtil.IsNullOrEmpty(param.InvoiceNo))
                {
                    List <dtViewBillingDetailListOfLastInvoiceOCC> listBillingDetail = handlerViewBilling.GetViewBillingDetailListOfLastInvoiceOCC(param.InvoiceNo, null, null, null, null);
                    for (int i = 0; i < listBillingDetail.Count(); i++)
                    {
                        listBillingDetail[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                    }
                    if (listBillingDetail.Count > 0)
                    {
                        List <dtViewBillingDetailList> lst = CommonUtil.ClonsObjectList <dtViewBillingDetailListOfLastInvoiceOCC, dtViewBillingDetailList>(listBillingDetail);
                        res.ResultData = CommonUtil.ConvertToXml <dtViewBillingDetailList>(lst, "Common\\CMS450_ViewBillingDetailInformation", CommonUtil.GRID_EMPTY_TYPE.VIEW);
                        return(Json(res));
                    }
                }
                for (int i = 0; i < list.Count(); i++)
                {
                    list[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                }
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }
            // test
            //list.RemoveRange(0, 670);
            res.ResultData = CommonUtil.ConvertToXml <dtViewBillingDetailList>(list, "Common\\CMS450_ViewBillingDetailInformation", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            return(Json(res));
        }
示例#16
0
        /// <summary>
        /// Retrieve receipt information of specific receipt no.
        /// </summary>
        /// <param name="param">receipt no.</param>
        /// <returns></returns>
        public ActionResult ICS060_GetReceipt(ICS060_ScreenParameter param)
        {
            ObjectResultData res = new ObjectResultData();

            res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
            doReceipt doReceipt;

            try
            {
                //Validate receipt business
                doReceipt = ICS060_ValidateReceiptBusiness(param, res);
                if (res.IsError || doReceipt == null)
                {
                    return(Json(res));
                }

                //Pass, Set doReceipt
                ICS060_ReceiptInformation result = new ICS060_ReceiptInformation();
                result.doReceipt = doReceipt;

                //Set cancel method
                IBillingHandler billingHandler = ServiceContainer.GetService <IBillingHandler>() as IBillingHandler;
                IIncomeHandler  incomeHandler  = ServiceContainer.GetService <IIncomeHandler>() as IIncomeHandler; // Add By Sommai P., Oct 31, 2013

                bool   isIssuedTaxInvoice       = billingHandler.CheckInvoiceIssuedTaxInvoice(doReceipt.InvoiceNo, doReceipt.InvoiceOCC);
                bool   isCancelTaxInvoiceOption = incomeHandler.CheckCancelTaxInvoiceOption(doReceipt.InvoiceNo, doReceipt.InvoiceOCC); // Add By Sommai P., Oct 31, 2013
                string filterValueCode          = "%";
                if (isIssuedTaxInvoice == false || isCancelTaxInvoiceOption == false)                                                   // Modify By Sommai P., Oct 31, 2013
                {
                    filterValueCode = CancelReceiptTarget.C_CANCEL_RECEIPT_ONLY;
                }

                ICommonHandler        commonHandler = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> miscs         = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CANCEL_RECEIPT_TARGET,
                        ValueCode = filterValueCode
                    }
                };
                ICommonHandler        hand     = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> lst      = hand.GetMiscTypeCodeList(miscs);
                ComboBoxModel         cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(lst, "ValueDisplay", "ValueCode");
                result.CancelMethodComboBoxModel = cboModel;
                res.ResultData = result;
                return(Json(res));
            }
            catch (Exception ex)
            {
                res             = new ObjectResultData();
                res.MessageType = MessageModel.MESSAGE_TYPE.INFORMATION;
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
示例#17
0
        public ActionResult CMS030_GetOperationOffice(string strDocumentType)
        {
            List <OfficeDataDo> nLst = new List <OfficeDataDo>();
            string strDisplayName    = "OfficeCodeName";

            try
            {
                List <OfficeDataDo> lst = (from p in CommonUtil.dsTransData.dtOfficeData
                                           where p.FunctionSecurity != FunctionSecurity.C_FUNC_SECURITY_NO
                                           orderby p.OfficeCode ascending
                                           select p).ToList <OfficeDataDo>();

                if (strDocumentType == DocumentType.C_DOCUMENT_TYPE_INSTALLATION)
                {
                    ICommonHandler        handlerCommon = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                    List <doMiscTypeCode> miscs         = new List <doMiscTypeCode>()
                    {
                        new doMiscTypeCode()
                        {
                            FieldName = MiscType.C_PROJECT_OFFICE_DUMMY,
                            ValueCode = "%"
                        }
                    };

                    List <doMiscTypeCode> doMiscs = handlerCommon.GetMiscTypeCodeList(miscs);

                    if (doMiscs != null && doMiscs.Count > 0)
                    {
                        OfficeDataDo tmpOffice = new OfficeDataDo();
                        tmpOffice.OfficeCode   = doMiscs[0].ValueCode;
                        tmpOffice.OfficeName   = doMiscs[0].ValueDisplay;
                        tmpOffice.OfficeNameEN = doMiscs[0].ValueDisplayEN;
                        tmpOffice.OfficeNameLC = doMiscs[0].ValueDisplayLC;
                        tmpOffice.OfficeNameJP = doMiscs[0].ValueDisplayJP;
                        lst.Add(tmpOffice);
                    }
                }

                lst = (from p in lst orderby p.OfficeCode ascending
                       select p).ToList <OfficeDataDo>();

                nLst = CommonUtil.ClonsObjectList <OfficeDataDo, OfficeDataDo>(lst);
                CommonUtil.MappingObjectLanguage <OfficeDataDo>(nLst);


                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <OfficeDataDo>(nLst, strDisplayName, "OfficeCode");

                return(Json(cboModel));
            }
            catch (Exception ex)
            {
                ObjectResultData res = new ObjectResultData();
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
示例#18
0
        /// <summary>
        /// Get contract data for view
        /// </summary>
        /// <param name="type"></param>
        /// <param name="contractPrefix"></param>
        /// <returns></returns>
        public ActionResult CMS100_LoadContract(string type, string contractPrefix)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CMS100_ScreenParameter CMS100Param   = GetScreenObject <CMS100_ScreenParameter>();
                IViewContractHandler   hand          = 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 <dtContractListGrp> lst = new List <dtContractListGrp>();
                if (type.Contains("CT"))
                {
                    if (type.Contains("Rental"))
                    {
                        lst = hand.GetContractListForViewCustGrp_CT_Rental(CMS100Param.GroupCode, contractPrefix);
                    }
                    else
                    {
                        lst = hand.GetContractListForViewCustGrp_CT_Sale(CMS100Param.GroupCode, contractPrefix);
                    }
                }
                else
                {
                    if (type.Contains("Rental"))
                    {
                        lst = hand.GetContractListForViewCustGrp_R_Rental(CMS100Param.GroupCode, contractPrefix);
                    }
                    else
                    {
                        lst = hand.GetContractListForViewCustGrp_R_Sale(CMS100Param.GroupCode, contractPrefix);
                    }
                }
                //Add Currency
                for (int i = 0; i < lst.Count(); i++)
                {
                    lst[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                }

                res.ResultData = CommonUtil.ConvertToXml <dtContractListGrp>(lst, "Common\\CMS100_ContractList", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }
            return(Json(res));
        }
示例#19
0
        /// <summary>
        /// Get maintenance contract target data list
        /// </summary>
        /// <param name="strContractCode"></param>
        /// <param name="strOCC"></param>
        /// <returns></returns>
        public ActionResult CMS140_GetMaintenanceContractTargetList(string strContractCode, string strOCC)
        {
            CommonUtil c = new CommonUtil();

            List <View_dtRelatedContract> nlst = new List <View_dtRelatedContract>();

            ObjectResultData res = new ObjectResultData();

            try
            {
                strContractCode = c.ConvertContractCode(strContractCode, CommonUtil.CONVERT_TYPE.TO_LONG);

                IRentralContractHandler handler       = ServiceContainer.GetService <IRentralContractHandler>() as IRentralContractHandler;
                ICommonHandler          comHand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode>   tmpCurrencies = comHand.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                }).ToList();
                List <dtRelatedContract> list = handler.GetRelatedContractList(RelationType.C_RELATION_TYPE_MA, strContractCode, strOCC);

                //Add Currency to List
                for (int i = 0; i < list.Count(); i++)
                {
                    list[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                }

                // Clone object to View object
                foreach (dtRelatedContract l in list)
                {
                    nlst.Add(CommonUtil.CloneObject <dtRelatedContract, View_dtRelatedContract>(l));
                }

                // Select language
                nlst = CommonUtil.ConvertObjectbyLanguage <View_dtRelatedContract, View_dtRelatedContract>(nlst, "ProductName");

                // convert to short format
                foreach (var item in nlst)
                {
                    // contractcode
                    item.RelatedContractCode = c.ConvertContractCode(item.RelatedContractCode, CommonUtil.CONVERT_TYPE.TO_SHORT);
                }
            }
            catch (Exception ex)
            {
                nlst = new List <View_dtRelatedContract>();
                res.AddErrorMessage(ex);
            }

            res.ResultData = CommonUtil.ConvertToXml <View_dtRelatedContract>(nlst, "Common\\CMS140_MaintenanceContract");
            return(Json(res));
        }
示例#20
0
        /// <summary>
        /// Generate all installation type combobox
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="InstallType"></param>
        /// <param name="attribute"></param>
        /// <param name="firstElement"></param>
        /// <returns></returns>
        public static MvcHtmlString InstallationTypeAllComboBoxWithFirstElement(this HtmlHelper helper, string id, string InstallType, object attribute = null, string firstElement = null)
        {
            string strDisplayName      = "ValueDisplayEN";
            List <doMiscTypeCode> lst  = new List <doMiscTypeCode>();
            List <doMiscTypeCode> lst2 = new List <doMiscTypeCode>();

            try
            {
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = "RentalInstallationType",
                        ValueCode = "%"
                    }
                };

                ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                lst = hand.GetMiscTypeCodeList(miscs);

                miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = "SaleInstallationType",
                        ValueCode = "%"
                    }
                };
                lst2 = hand.GetMiscTypeCodeList(miscs);

                foreach (doMiscTypeCode dtl in lst2)
                {
                    lst.Add(dtl);
                }
            }
            catch
            {
            }

            return(CommonUtil.CommonComboBoxWithCustomFirstElement <doMiscTypeCode>(id, lst, "ValueDisplay", "ValueCode", firstElement, attribute, true));
        }
示例#21
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; }
        }
示例#22
0
        /// <summary>
        /// Generate lock status combobox for screen QUS010
        /// </summary>
        /// <param name="helper"></param>
        /// <param name="id"></param>
        /// <param name="attribute"></param>
        /// <param name="firstElement"></param>
        /// <returns></returns>
        public static MvcHtmlString LockStatusComboQUS010(this HtmlHelper helper, string id, object attribute = null, string firstElement = null)
        {
            ICommonHandler        hand            = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <doMiscTypeCode> lstMiscTypeCode = new List <doMiscTypeCode>();
            doMiscTypeCode        MiscTypeCode    = new doMiscTypeCode();

            MiscTypeCode.FieldName = MiscType.C_LOCK_STATUS;
            MiscTypeCode.ValueCode = "%";
            lstMiscTypeCode.Add(MiscTypeCode);
            List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(lstMiscTypeCode);

            return(CommonUtil.CommonComboBoxWithCustomFirstElement <doMiscTypeCode>(id, MiscLock, "ValueCodeDisplay", "ValueCode", firstElement, attribute));
        }
示例#23
0
        /// <summary>
        /// Get misctype data by code
        /// </summary>
        /// <param name="FieldName"></param>
        /// <param name="ValueCode"></param>
        /// <returns></returns>
        public ActionResult ISS080_GetMiscTypeByValueCode(string FieldName, string ValueCode)
        {
            ObjectResultData res = new ObjectResultData();

            List <doMiscTypeCode> lst = new List <doMiscTypeCode>();
            string lang = CommonUtil.GetCurrentLanguage();

            try
            {
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = FieldName,
                        ValueCode = ValueCode
                    }
                };

                ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                lst = hand.GetMiscTypeCodeList(miscs);

                if (lst.Count > 0)
                {
                    if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_EN)
                    {
                        res.ResultData = lst[0].ValueCode + " : " + lst[0].ValueDisplayEN;
                    }
                    else if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_JP)
                    {
                        res.ResultData = lst[0].ValueCode + " : " + lst[0].ValueDisplayJP;
                    }
                    else if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_LC)
                    {
                        res.ResultData = lst[0].ValueCode + " : " + lst[0].ValueDisplayLC;
                    }
                }
                else
                {
                    res.ResultData = null;
                }

                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
        /// <summary>
        /// Validate before add instrument.
        /// </summary>
        /// <param name="Cond"></param>
        /// <returns></returns>
        public ActionResult IVS040_beforeAddElem(IVS040INST Cond)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                IVS040_ScreenParameter prm = GetScreenObject <IVS040_ScreenParameter>();
                if (prm.ElemInstrument == null)
                {
                    prm.ElemInstrument = new List <IVS040INST>();
                }


                foreach (IVS040INST i in prm.ElemInstrument)
                {
                    if (i.InstrumentCode == Cond.InstrumentCode && i.AreaCode == Cond.AreaCode)
                    {
                        res.AddErrorMessage(MessageUtil.MODULE_INVENTORY, MessageUtil.MessageList.MSG4005);
                        res.MessageType = MessageModel.MESSAGE_TYPE.WARNING;
                        return(Json(res));
                    }
                }
                ICommonHandler comHand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                Cond.Currencies = comHand.GetMiscTypeCodeList(new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_CURRENCT,
                        ValueCode = "%"
                    }
                }).ToList();

                // Default Currency "Rp." Pachara S. 12102016
                Cond.TransferAmountCurrencyType = SECOM_AJIS.Common.Util.ConstantValue.CurrencyUtil.C_CURRENCY_LOCAL;

                prm.ElemInstrument.Add(Cond);

                UpdateScreenObject(prm);

                res.ResultData = true;
                return(Json(true));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex); return(Json(res));
            }
        }
示例#25
0
        /// <summary>
        /// Get misctype display by code
        /// </summary>
        /// <param name="FieldName"></param>
        /// <param name="ValueCode"></param>
        /// <returns></returns>
        public string ISS080_GetMiscDisplayByValueCode(string FieldName, string ValueCode)
        {
            ObjectResultData      res        = new ObjectResultData();
            string                strDisPlay = "";
            List <doMiscTypeCode> lst        = new List <doMiscTypeCode>();
            string                lang       = CommonUtil.GetCurrentLanguage();

            try
            {
                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = FieldName,
                        ValueCode = ValueCode
                    }
                };

                ICommonHandler hand = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                lst = hand.GetMiscTypeCodeList(miscs);

                if (lst.Count > 0)
                {
                    if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_EN)
                    {
                        strDisPlay = lst[0].ValueDisplayEN;
                    }
                    else if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_JP)
                    {
                        strDisPlay = lst[0].ValueDisplayJP;
                    }
                    else if (lang == SECOM_AJIS.Common.Util.ConstantValue.CommonValue.DEFAULT_LANGUAGE_LC)
                    {
                        strDisPlay = lst[0].ValueDisplayLC;
                    }
                }
                else
                {
                    strDisPlay = "";
                }
            }
            catch (Exception ex)
            {
            }
            return(strDisPlay);
        }
示例#26
0
        /// <summary>
        /// Get View Billin gBasic
        /// </summary>
        /// <param name="strBillingTargetCode"></param>
        /// <returns></returns>
        public ActionResult CMS400_GetViewBillingBasicForGrid(string strBillingTargetCode)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CommonUtil          cm = new CommonUtil();
                IViewBillingHandler handlerViewBilling = ServiceContainer.GetService <IViewBillingHandler>() as IViewBillingHandler;
                if (!CommonUtil.IsNullOrEmpty(strBillingTargetCode))
                {
                    strBillingTargetCode = cm.ConvertBillingTargetCode(strBillingTargetCode, CommonUtil.CONVERT_TYPE.TO_LONG);
                }

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

                List <dtViewBillingBasicList> lst = handlerViewBilling.GetViewBillingBasicList(
                    null,
                    strBillingTargetCode,
                    null,
                    null,
                    null,
                    null
                    );

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

                res.ResultData = CommonUtil.ConvertToXml <dtViewBillingBasicList>(lst, "Common\\CMS400_BillingBasic", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
            return(Json(res));
        }
示例#27
0
        public ActionResult MAS080()
        {
            MAS080_ScreenParameter MAS080Param = new MAS080_ScreenParameter();

            ViewBag.HasPermissionAdd    = "";
            ViewBag.HasPermissionEdit   = "";
            ViewBag.HasPermissionDelete = "";
            ViewBag.FunctionView        = FunctionID.C_FUNC_ID_VIEW;
            ViewBag.FunctionOperate     = FunctionID.C_FUNC_ID_OPERATE;
            ViewBag.FunctionPlanner     = FunctionID.C_FUNC_ID_PLANNER;

            try
            {
                ICommonHandler        hand            = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <doMiscTypeCode> lstMiscTypeCode = new List <doMiscTypeCode>();
                doMiscTypeCode        MiscTypeCode    = new doMiscTypeCode();
                MiscTypeCode.FieldName = MiscType.C_PERMISSION_TYPE;
                MiscTypeCode.ValueCode = "%";
                lstMiscTypeCode.Add(MiscTypeCode);
                List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(lstMiscTypeCode);
                foreach (doMiscTypeCode i in MiscLock)
                {
                    if (i.ValueCode == PermissionType.C_PERMISSION_TYPE_OFFICE)
                    {
                        ViewBag.PermissionTypeOffice = i.ValueDisplay;
                    }
                    else
                    {
                        ViewBag.PermissionTypeIndividual = i.ValueDisplay;
                    }
                }

                MAS080Param = GetScreenObject <MAS080_ScreenParameter>();
                ViewBag.HasPermissionAdd    = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_PERMISSION_GROUP_INFO, FunctionID.C_FUNC_ID_ADD);
                ViewBag.HasPermissionEdit   = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_PERMISSION_GROUP_INFO, FunctionID.C_FUNC_ID_EDIT);
                ViewBag.HasPermissionDelete = CheckUserPermission(ScreenID.C_SCREEN_ID_MAINTAIN_PERMISSION_GROUP_INFO, FunctionID.C_FUNC_ID_DEL);
                ViewBag.FunctionView        = FunctionID.C_FUNC_ID_VIEW;
            }
            catch
            {
            }

            return(View());
        }
        public ActionResult GetAdminCombo(string filter)
        {
            try {
                string         strDisplay = "ValueDisplay";
                ICommonHandler hand       = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;

                List <doMiscTypeCode> miscs = new List <doMiscTypeCode>()
                {
                    new doMiscTypeCode()
                    {
                        FieldName = MiscType.C_INCIDENT_ROLE,
                        ValueCode = IncidentRole.C_INCIDENT_ROLE_CHIEF
                    }
                };
                miscs.Add(new doMiscTypeCode()
                {
                    FieldName = MiscType.C_INCIDENT_ROLE,
                    ValueCode = IncidentRole.C_INCIDENT_ROLE_CORRESPONDENT
                });

                List <doMiscTypeCode> MiscLock = hand.GetMiscTypeCodeList(miscs);

                foreach (doMiscTypeCode i in MiscLock)
                {
                    i.ValueDisplay = i.ValueCode + ':' + i.ValueDisplay;
                }

                string         administrator = CommonUtil.GetLabelFromResource(MessageUtil.MODULE_CONTRACT, ScreenID.C_SCREEN_ID_SEARCH_INCIDENT, "txtAdmin");
                doMiscTypeCode first         = new doMiscTypeCode();
                first.ValueCode    = "";
                first.ValueDisplay = administrator;
                MiscLock.Insert(0, first);

                ComboBoxModel cboModel = new ComboBoxModel();
                cboModel.SetList <doMiscTypeCode>(MiscLock, strDisplay, "ValueCode", false);

                return(Json(cboModel));
            } catch (Exception ex) {
                // return Json(MessageUtil.GetMessage(ex));
                return(null);
            }
        }
示例#29
0
        /// <summary>
        /// Load Incident/AR Type by selected serviceType.
        /// </summary>
        /// <param name="serviceType"></param>
        /// <returns></returns>
        public ActionResult ListMiscIncidentARType(string serviceType)
        {
            ICommonHandler        handCom      = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
            List <doMiscTypeCode> MiscTypeCode = new List <doMiscTypeCode>();

            for (int i = 0; i < 2; i++)
            {
                MiscTypeCode.Add(new doMiscTypeCode());
            }
            MiscTypeCode[0].FieldName = MiscType.C_INCIDENT_TYPE;
            MiscTypeCode[0].ValueCode = "%";
            MiscTypeCode[1].FieldName = MiscType.C_AR_TYPE;
            MiscTypeCode[1].ValueCode = "%";
            List <doMiscTypeCode> MiscTypeResult = handCom.GetMiscTypeCodeList(MiscTypeCode);

            ComboBoxModel CbxModel = new ComboBoxModel();

            CbxModel.SetList <doMiscTypeCode>(MiscTypeResult, "ValueCodeDisplay", "ValueCode", false);
            return(Json(CbxModel));
        }
        /// <summary>
        /// Getting billing type detail list for load to grid with initial
        /// </summary>
        /// <returns></returns>
        public ActionResult CMS420_LoadGridBillingTypeDetailWithInitial()
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CMS420_ScreenParameter param = GetScreenObject <CMS420_ScreenParameter>();
                CommonUtil             cm    = new CommonUtil();

                string strContractCode_short = param.ContractCode;
                string strContractCode       = cm.ConvertContractCode(strContractCode_short, CommonUtil.CONVERT_TYPE.TO_LONG);

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

                List <doBillingTypeDetailList> billingTypeDetailListData = billingHandler.GetBillingTypeDetailList(strContractCode, param.BillingOCC);
                CommonUtil.MappingObjectLanguage <doBillingTypeDetailList>(billingTypeDetailListData);

                if (billingTypeDetailListData == null)
                {
                    billingTypeDetailListData = new List <doBillingTypeDetailList>();
                }

                string xml = CommonUtil.ConvertToXml <doBillingTypeDetailList>(billingTypeDetailListData, "Common\\CMS420_BillingTypeDetail", CommonUtil.GRID_EMPTY_TYPE.SEARCH);
                res.ResultData = xml;
                return(Json(res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }