Ejemplo n.º 1
0
        /// <summary>
        /// Validate Contract information condition.
        /// </summary>
        /// <param name="Cond"></param>
        /// <returns></returns>
        public ActionResult CMS150Valid(doContractInfoCondition Cond)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                if (ModelState.IsValid == false)
                {
                    ValidatorUtil.BuildErrorMessage(res, this);
                }
                res.ResultData = true;
            }
            catch (Exception ex)
            {
                return(Json(ex));
            }
            return(Json(res));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get maintenance check-up result by search condition
        /// </summary>
        /// <param name="cond"></param>
        /// <returns></returns>
        public ActionResult CMS210_GetMaintCheckUpResultList(doContractInfoCondition cond)
        {
            CommonUtil c = new CommonUtil();

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

            ObjectResultData res = new ObjectResultData();

            try
            {
                cond.ContractCode         = c.ConvertContractCode(cond.ContractCode, CommonUtil.CONVERT_TYPE.TO_LONG);
                cond.MATargetContractCode = c.ConvertContractCode(cond.MATargetContractCode, CommonUtil.CONVERT_TYPE.TO_LONG);


                IViewContractHandler            handler = ServiceContainer.GetService <IViewContractHandler>() as IViewContractHandler;
                List <dtMaintCheckUpResultList> list    = handler.GetMaintCheckUpResultList(cond.ContractCode, cond.MATargetContractCode, cond.ProductCode);


                list = CommonUtil.ConvertObjectbyLanguage <dtMaintCheckUpResultList, dtMaintCheckUpResultList>(list,
                                                                                                               "SubContractorName",
                                                                                                               "MaintEmpFirstName",
                                                                                                               "MaintEmpLastName");



                // clone object to View
                foreach (dtMaintCheckUpResultList l in list)
                {
                    nlst.Add(CommonUtil.CloneObject <dtMaintCheckUpResultList, View_dtMaintCheckUpResultList>(l));
                }
            }
            catch (Exception ex)
            {
                nlst = new List <View_dtMaintCheckUpResultList>();
                res.AddErrorMessage(ex);
            }

            res.ResultData = CommonUtil.ConvertToXml <View_dtMaintCheckUpResultList>(nlst, "Common\\CMS210", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            return(Json(res));
        }
        /// <summary>
        /// Check parameter valid.
        /// </summary>
        /// <param name="cond"></param>
        /// <returns></returns>
        public ActionResult CMS300_Authority(CMS300_ScreenParameter cond) // IN parameter: ContractCode , ServiceTypeCode
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                // Check parameter is OK ?
                //if ((ModelState.IsValid == false) && ( CommonUtil.IsNullOrEmpty(cond.ContractCode) == true || CommonUtil.IsNullOrEmpty(cond.ServiceTypeCode) == true))
                //{
                //    ValidatorUtil.BuildErrorMessage(res, this);
                //    return Json(res);
                //}
                if (CommonUtil.IsNullOrEmpty(cond.ContractCode))
                {
                    res.AddErrorMessage(MessageUtil.MODULE_COMMON, MessageUtil.MessageList.MSG0040);
                    return(Json(res));
                }

                doContractInfoCondition param = new doContractInfoCondition();
                // Check parameter is OK ?
                //if (CommonUtil.IsNullOrEmpty(cond.ContractCode) == false && CommonUtil.IsNullOrEmpty(cond.ServiceTypeCode) == false) {
                if (CommonUtil.IsNullOrEmpty(cond.ContractCode) == false)
                {
                    param = new doContractInfoCondition()
                    {
                        ContractCode    = cond.ContractCode,
                        ServiceTypeCode = cond.ServiceTypeCode
                    };
                }

                return(InitialScreenEnvironment <CMS300_ScreenParameter>(CMS300_Screen, cond, res));
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
                return(Json(res));
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Get changed customer history list by condition
 /// </summary>
 /// <param name="cond"></param>
 /// <returns></returns>
 public List <dtChangedCustHistList2> GetChangedCustHistList2(doContractInfoCondition cond)
 {
     return(base.GetChangedCustHistList2(cond.ContractCode, cond.OCC, cond.CSCustCode, cond.RCCustCode, cond.SiteCode));
 }
        /// <summary>
        /// Get billing temporary list by condition
        /// </summary>
        /// <param name="cond"></param>
        /// <returns></returns>
        public ActionResult CMS200_GetBillingTempList(doContractInfoCondition cond)
        {
            CommonUtil c = new CommonUtil();

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

            ObjectResultData res = new ObjectResultData();

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

                ICommonContractHandler handler       = ServiceContainer.GetService <ICommonContractHandler>() as ICommonContractHandler;
                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_BillingTempListForView> list = handler.GetTbt_BillingTempListForView(cond.ContractCode, null);

                //Add Currency
                for (int i = 0; i < list.Count(); i++)
                {
                    if (list[i].BillingAmtCurrencyType == SECOM_AJIS.Common.Util.ConstantValue.CurrencyUtil.C_CURRENCY_US)
                    {
                        list[i].BillingAmt = list[i].BillingAmtUsd;
                    }
                    list[i].Currencies = new List <doMiscTypeCode>(tmpCurrencies);
                }

                // clone object to View
                foreach (dtTbt_BillingTempListForView l in list)
                {
                    nlst.Add(CommonUtil.CloneObject <dtTbt_BillingTempListForView, View_dtTbt_BillingTempListForView>(l));
                }


                // select language
                nlst = CommonUtil.ConvertObjectbyLanguage <View_dtTbt_BillingTempListForView, View_dtTbt_BillingTempListForView>(nlst, "BillingOffice");

                // get misc display value
                ICommonHandler handlerComm  = ServiceContainer.GetService <ICommonHandler>() as ICommonHandler;
                List <string>  lsFieldNames = new List <string>();
                lsFieldNames.Add(MiscType.C_BILLING_TIMING);
                lsFieldNames.Add(MiscType.C_CONTRACT_BILLING_TYPE);
                lsFieldNames.Add(MiscType.C_PAYMENT_METHOD);

                List <doMiscTypeCode> MiscTypeList = handlerComm.GetMiscTypeCodeListByFieldName(lsFieldNames);

                string strDisplayValue = string.Empty;
                foreach (var item in nlst)
                {
                    strDisplayValue = handlerComm.GetMiscDisplayValue(MiscTypeList,
                                                                      MiscType.C_BILLING_TIMING,
                                                                      item.BillingTiming)
                    ;
                    item.BillingTiming_EX = strDisplayValue; // CommonUtil.TextCodeName(item.BillingTiming, strDisplayValue);

                    strDisplayValue = handlerComm.GetMiscDisplayValue(MiscTypeList,
                                                                      MiscType.C_CONTRACT_BILLING_TYPE,
                                                                      item.BillingType);
                    item.BillingType_EX = strDisplayValue; // CommonUtil.TextCodeName(item.BillingType, strDisplayValue);

                    strDisplayValue = handlerComm.GetMiscDisplayValue(MiscTypeList,
                                                                      MiscType.C_PAYMENT_METHOD,
                                                                      item.PayMethod);
                    item.Paymethod_EX = strDisplayValue; // CommonUtil.TextCodeName(item.PayMethod, strDisplayValue);
                }

                // Sorting , order by BillingOCC
                nlst = (from p in nlst orderby p.BillingOCC ascending select p).ToList <View_dtTbt_BillingTempListForView>();
            }
            catch (Exception ex)
            {
                nlst = new List <View_dtTbt_BillingTempListForView>();
                res.AddErrorMessage(ex);
            }

            res.ResultData = CommonUtil.ConvertToXml <View_dtTbt_BillingTempListForView>(nlst, "Common\\CMS200");
            return(Json(res));
        }