Exemplo n.º 1
0
        public static void CaculateIndividualBusiness(long sotienkhachhangdangkyvay, long doanhthutrungbinh3thang, long doanhthuthangthapnhat, int thoihanconlaicuahopdong, long giatritiendatcoc, long giatritienthueconlaikhachhangdadong, long giatritaisan, int hinhthuccutru, int nhomCIC, int loantime, ref long tonghanmucchovay, ref long tonglaivaphithangdau, ref long tongtientattoan)
        {
            decimal T1 = 0.1M; decimal S1 = 0;
            decimal T2 = 0.1M; decimal S2 = 0;
            decimal T3 = 0.15M; decimal S3 = 0;
            decimal T4 = 0.3M; decimal S4 = 0;
            decimal T5 = 0.05M; decimal S5 = 0;
            decimal T6 = 0.3M; decimal S6 = 0;

            // Tinh S1
            S1 = ((thoihanconlaicuahopdong / 6) >= 1) ? 1 : 0;
            // Tinh S2
            S2 = ((giatritiendatcoc + giatritienthueconlaikhachhangdadong) / sotienkhachhangdangkyvay) >= 1 ? 1 : 0;
            // Tinh S3
            S3 = ((giatritaisan / (2 * sotienkhachhangdangkyvay)) >= 1) ? 1 : 0;
            // Tinh S4
            S4 = (((doanhthuthangthapnhat / 2) / sotienkhachhangdangkyvay) >= 1) ? 1 : 0;
            // Tinh S5
            S5 = (hinhthuccutru == 1) ? 1 : 0;
            // Tinh S6
            if (nhomCIC == 1)
            {
                S6 = 1;
            }
            else if (nhomCIC == 2)
            {
                S6 = 0.8M;
            }
            else
            {
                S6 = 0;
            }

            decimal ScoreCreadit = 0;

            ScoreCreadit = T1 * S1 + T2 * S2 + T3 * S3 + T4 * S4 + T5 * S5 + T6 * S6;

            long _hanmuchovay = 0;

            _hanmuchovay     = Convert.ToInt64((doanhthutrungbinh3thang * ScoreCreadit) / 2);
            tonghanmucchovay = _hanmuchovay;
            tonghanmucchovay = Common.RoundingTo(_hanmuchovay, 100000);

            long _tienlaivaphithangdau = 0;

            _tienlaivaphithangdau = (tonghanmucchovay * 5000 / 1000000) * 30; //Convert.ToInt64(tonghanmucchovay * (Models.Constants.RateConsultant + Models.Constants.RateService + Models.Constants.Rate) * loantime);
            tonglaivaphithangdau  = _tienlaivaphithangdau;

            long _tientattoan = 0;

            _tientattoan    = tonghanmucchovay + (tonghanmucchovay * 5000 / 1000000) * 30;// Entity.Common.RoundingTo(tonghanmucchovay, 100000); //Convert.ToInt64(tonghanmucchovay + tonghanmucchovay * (Models.Constants.RateConsultant + Models.Constants.RateService + Models.Constants.Rate) * loantime);
            tongtientattoan = _tientattoan;
        }