示例#1
0
        public object OnCbsSearch(string accno, string mblAcc)
        {
            try
            {
                var  cbsCustomerInfo = (MtCbsinfo)_repository.GetCbsCustomerInfo(accno);
                bool isRegInfoExist  = _repository.IsRegInfoExist(mblAcc);

                if (!isRegInfoExist)
                {
                    return("REGNOEXST");                    //reginfo not exist
                }

                if (cbsCustomerInfo != null)
                {
                    var isPendingExist = _repository.CheckPendingAccountByMphone(mblAcc);
                    if (Convert.ToInt32(isPendingExist) != 0)
                    {
                        return("PE");
                    }
                    else if (cbsCustomerInfo.Mobnum != mblAcc)
                    {
                        return("MMCAMA");                        // miss match cbs account mobile no and ok wallet mobile no
                    }
                    var IsActiveAccountExist = _repository.CheckActivatdAccountByMphone(mblAcc);
                    if (Convert.ToInt32(IsActiveAccountExist) >= 3)
                    {
                        return("EACCM3");                        // Exist Account more than 2
                    }
                    var IsAccNoIsMappedByMblNo = _repository.CheckAccNoIsMappedByMblNo(mblAcc, accno);
                    if (Convert.ToInt32(IsAccNoIsMappedByMblNo) != 0)
                    {
                        return("EACC");                        // exist cbs account
                    }
                    var IsCbsValidClass = _repository.CheckCbsValidClass(cbsCustomerInfo.Class);
                    if (Convert.ToInt32(IsCbsValidClass) != 1)
                    {
                        return("MCC");                        // missing cbs class
                    }
                    //if (cbsCustomerInfo.Nationid == "")
                    //{
                    //	return "NIDNULL"; // missing NID Info
                    //}
                }
                else
                {
                    return(HttpStatusCode.InternalServerError);
                }
                return(cbsCustomerInfo);
            }


            catch (Exception ex)
            {
                throw ex;
            }
        }