Beispiel #1
0
 public void GetBibitong()
 {
     bibitong = Bibitong.Get(id);
 }
Beispiel #2
0
        public static Bibitong Get(int spId)
        {
            Bibitong bbt = new Bibitong();

            bbt.supplierId = spId;
            /*
             BibitongGet
             @spId int
             */

            //[GeneralScore],[IndustryCount],[Priority],
            //[S_AVG],[R_AVG],[Q_AVG],[V_AVG],[C_AVG],
            //[S_A],[S_B],[S_C],[S_D],[S_E],
            //[R_A],[R_B],[R_C],[R_D],[R_E],
            //[Q_A],[Q_B],[Q_C],[Q_D],[Q_E],
            //[V_A],[V_B],[V_C],[V_D],[V_E],
            //[C_A],[C_B],[RecommCount],Cert1Count,Cert2Count

            SqlDataReader reader = null;

            try
            {
                reader = Database.ExecuteReader(CommandType.StoredProcedure, "BibitongGet",
                    new SqlParameter[] { Database.MakeInParam("@spId", SqlDbType.Int, spId) });

                if (reader.Read())
                {
                    bbt.generalScore = Convert.ToSingle(reader.GetValue(0));
                    bbt.industryCount = reader.GetInt32(1);
                    bbt.priority = reader.GetInt32(2);

                    bbt.specialtyAvg = Convert.ToSingle(reader.GetValue(3));
                    bbt.responsibilityAvg = Convert.ToSingle(reader.GetValue(4));
                    bbt.qualityAvg = Convert.ToSingle(reader.GetValue(5));
                    bbt.valuablyAvg = Convert.ToSingle(reader.GetValue(6));
                    bbt.caseScore =Convert.ToSingle(reader.GetValue(7));

                    bbt.specialties[0] = reader.GetInt32(8);
                    bbt.specialties[1] = reader.GetInt32(9);
                    bbt.specialties[2] = reader.GetInt32(10);
                    bbt.specialties[3] = reader.GetInt32(11);
                    bbt.specialties[4] = reader.GetInt32(12);

                    bbt.responsibilities[0] = reader.GetInt32(13);
                    bbt.responsibilities[1] = reader.GetInt32(14);
                    bbt.responsibilities[2] = reader.GetInt32(15);
                    bbt.responsibilities[3] = reader.GetInt32(16);
                    bbt.responsibilities[4] = reader.GetInt32(17);

                    bbt.qualities[0] = reader.GetInt32(18);
                    bbt.qualities[1] = reader.GetInt32(19);
                    bbt.qualities[2] = reader.GetInt32(20);
                    bbt.qualities[3] = reader.GetInt32(21);
                    bbt.qualities[4] = reader.GetInt32(22);

                    bbt.valuablies[0] = reader.GetInt32(23);
                    bbt.valuablies[1] = reader.GetInt32(24);
                    bbt.valuablies[2] = reader.GetInt32(25);
                    bbt.valuablies[3] = reader.GetInt32(26);
                    bbt.valuablies[4] = reader.GetInt32(27);

                    bbt.goodCaseCount = reader.GetInt32(28);
                    bbt.badCaseCount = reader.GetInt32(29);

                    bbt.recommendCount = reader.GetInt32(30);

                    bbt.cert1Count = reader.GetInt32(31);
                    bbt.cert2Count = reader.GetInt32(32);

                }

                reader.Close();
            }
            catch
            {

            }
            finally
            {
                if (reader != null)
                {
                    reader.Close();
                }
            }

            return bbt;
        }
Beispiel #3
0
 protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     BBT = Bibitong.Get(SupplierId);
 }