Exemplo n.º 1
0
        public static DisplayMessageModel getDisplay(int TypeBianHao)
        {
            DisplayMessageModel message = new DisplayMessageModel();

            message.TypeBianHao = TypeBianHao;

            try
            {
                initConnection();
            }
            catch (Exception e)
            {
                throw e;
            }

            com.CommandText = "select MiaoShu,TuPianBianHao,TuPianMiaoShu,GongNengBianHao,GongNengMiaoShu from 粮食种类描述表,粮食图片描述表,粮食功能描述表 where 粮食种类描述表.TypeBianHao = " + TypeBianHao + "and 粮食图片描述表.TypeBianHao = " + TypeBianHao + "and 粮食功能描述表.TypeBianHao =" + TypeBianHao;
            dr = com.ExecuteReader();
            while (dr.Read())
            {
                message.TypeMiaoShu = Convert.ToString(dr["miaoshu"]);
                message.TuPianBianHao.Add(Convert.ToInt16(dr["TuPianBianHao"]));
                message.TuPianMiaoShu.Add(Convert.ToString(dr["TuPianMiaoShu"]));
                message.GongNengBianHao.Add(Convert.ToInt16(dr["GongNengBianHao"]));
                message.GongNengMiaoShu.Add(Convert.ToString(dr["GongNengMiaoShu"]));
            }
            dr.Close();     //关闭执行
            sqlCon.Close(); //关闭数据库

            return(message);
        }
Exemplo n.º 2
0
 public void getMiaoShu()
 {
     try
     {
         RiceMessage   = SqlData.getDisplay(2);
         CoreMessage   = SqlData.getDisplay(1);
         WheateMessage = SqlData.getDisplay(3);
     }
     catch (Exception e)
     {
         throw e;
     }
 }