Beispiel #1
0
        public static Entity.ProvinceWeiCi ProvinceWeiCiEntityGetByFenShu(int FenShu, int DataYear, int ProvinceId, int KeLei, int PiCi)
        {
            Entity.ProvinceWeiCi info = new Entity.ProvinceWeiCi();
            string    strSql          = "SELECT TOP 1 * FROM [ProvinceWeiCi] WHERE ProvinceId = " + ProvinceId + " AND KeLei = " + KeLei + " AND FenShu <= " + FenShu + "  AND [DataYear]=" + DataYear + " AND PiCi = " + PiCi + " ORDER BY IsKaoshiyuan DESC,WeiCi ASC,PiCi asc ";
            DataTable dt = SqlDB.ExecuteDataset(CommandType.Text, strSql).Tables[0];

            if (dt.Rows.Count > 0)
            {
                info.Id             = Basic.Utils.StrToInt(dt.Rows[0]["Id"].ToString(), 0);
                info.ProvinceName   = dt.Rows[0]["ProvinceName"].ToString();
                info.ProvinceId     = Basic.Utils.StrToInt(dt.Rows[0]["ProvinceId"].ToString(), 0);
                info.KeLeiMingCheng = dt.Rows[0]["KeLeiMingCheng"].ToString();
                info.KeLei          = Basic.Utils.StrToInt(dt.Rows[0]["KeLei"].ToString(), 0);
                info.DataYear       = Basic.Utils.StrToInt(dt.Rows[0]["DataYear"].ToString(), 0);
                info.FenShu         = Basic.Utils.StrToInt(dt.Rows[0]["FenShu"].ToString(), 0);
                info.RenShu         = Basic.Utils.StrToInt(dt.Rows[0]["RenShu"].ToString(), 0);
                info.LeiJiRenShu    = Basic.Utils.StrToInt(dt.Rows[0]["LeiJiRenShu"].ToString(), 0);
                info.WeiCi          = Basic.Utils.StrToInt(dt.Rows[0]["WeiCi"].ToString(), 0);
                info.IsKaoShiYuan   = Basic.Utils.StrToInt(dt.Rows[0]["IsKaoShiYuan"].ToString(), 0);
                info.FenGe          = Basic.Utils.StrToInt(dt.Rows[0]["FenGe"].ToString(), 0);
            }
            else
            {
                return(null);
            }
            return(info);
        }
Beispiel #2
0
        public static Entity.StudentChengJi GetZheJiangUserPiCi(Entity.FenShuXian fenshuxian, int FenShu, int DataYear, int ProvinceId, int KeLei)
        {
            Entity.StudentChengJi studentChengJi = new Entity.StudentChengJi();
            int PcFirst  = fenshuxian.PcFirst;
            int PcSecond = fenshuxian.PcSecond;
            int PcThird  = fenshuxian.PcThird;
            int ZkFirst  = fenshuxian.ZkFirst;
            int ZkSecond = fenshuxian.ZkSecond;

            if (FenShu >= PcFirst)
            {
                studentChengJi.PiCi         = 1;
                studentChengJi.XianChaShang = 0;                //上一批次的线差
                studentChengJi.XianCha      = FenShu - PcFirst; //批次线差
                studentChengJi.PiCiXian     = PcFirst;
            }
            else if (FenShu >= PcSecond)
            {
                studentChengJi.PiCi         = 2;
                studentChengJi.XianChaShang = PcFirst - FenShu;  //上一批次的线差
                studentChengJi.XianCha      = FenShu - PcSecond; //批次线差
                studentChengJi.PiCiXian     = PcSecond;
            }
            else if (PcThird != 0 && FenShu >= PcThird)
            {
                studentChengJi.PiCi         = 3;
                studentChengJi.XianChaShang = PcSecond - FenShu; //上一批次的线差
                studentChengJi.XianCha      = FenShu - PcThird;  //批次线差
                studentChengJi.PiCiXian     = PcThird;
            }
            else if (ZkFirst != 0 && FenShu >= ZkFirst)
            {
                studentChengJi.PiCi         = 4;
                studentChengJi.XianChaShang = (PcThird == 0 ? PcSecond : PcThird) - FenShu; //上一批次的线差
                studentChengJi.XianCha      = FenShu - ZkFirst;                             //批次线差
                studentChengJi.PiCiXian     = ZkFirst;
            }
            else if (ZkSecond != 0 && FenShu >= ZkSecond)
            {
                studentChengJi.PiCi         = 5;
                studentChengJi.XianChaShang = ZkFirst - FenShu;  //上一批次的线差
                studentChengJi.XianCha      = FenShu - ZkSecond; //批次线差
                studentChengJi.PiCiXian     = ZkSecond;
            }
            else
            {
                studentChengJi.PiCi         = 0;
                studentChengJi.XianChaShang = 0; //上一批次的线差
                studentChengJi.XianCha      = 0; //批次线差
                studentChengJi.PiCiXian     = 0;
            }

            //下面根据成绩来取位次等信息
            Entity.ProvinceWeiCi provinceWeiCi = DAL.ProvinceWeiCi.ProvinceWeiCiEntityGetByFenShu(FenShu, DataYear, ProvinceId, KeLei);
            if (provinceWeiCi == null)
            {
                studentChengJi.WeiCi       = 0;
                studentChengJi.RenShu      = 0;
                studentChengJi.LeiJiRenShu = 0;
            }
            else
            {
                studentChengJi.WeiCi       = provinceWeiCi.WeiCi;
                studentChengJi.RenShu      = provinceWeiCi.RenShu;
                studentChengJi.LeiJiRenShu = provinceWeiCi.LeiJiRenShu;
            }
            studentChengJi.FenShu = FenShu;

            return(studentChengJi);
        }