コード例 #1
0
        /// <summary>
        /// Get customer data for view
        /// </summary>
        /// <param name="type"></param>
        /// <param name="contractPrefix"></param>
        /// <returns></returns>
        public ActionResult CMS100_LoadCustomer(string type, string contractPrefix)
        {
            ObjectResultData res = new ObjectResultData();

            try
            {
                CMS100_ScreenParameter   CMS100Param = GetScreenObject <CMS100_ScreenParameter>();
                IViewContractHandler     hand        = ServiceContainer.GetService <IViewContractHandler>() as IViewContractHandler;
                List <dtCustomerListGrp> lst         = new List <dtCustomerListGrp>();
                if (type.Contains("CT"))
                {
                    if (type.Contains("Rental"))
                    {
                        lst = hand.GetCustomerListForViewCustGrp_CT_Rental(CMS100Param.GroupCode, contractPrefix);
                    }
                    else
                    {
                        lst = hand.GetCustomerListForViewCustGrp_CT_Sale(CMS100Param.GroupCode, contractPrefix);
                    }
                }
                else
                {
                    if (type.Contains("Rental"))
                    {
                        lst = hand.GetCustomerListForViewCustGrp_R_Rental(CMS100Param.GroupCode, contractPrefix);
                    }
                    else
                    {
                        lst = hand.GetCustomerListForViewCustGrp_R_Sale(CMS100Param.GroupCode, contractPrefix);
                    }
                }
                res.ResultData = CommonUtil.ConvertToXml <dtCustomerListGrp>(lst, "Common\\CMS100_CustomerList", CommonUtil.GRID_EMPTY_TYPE.VIEW);
            }
            catch (Exception ex)
            {
                res.AddErrorMessage(ex);
            }
            return(Json(res));
        }