Esempio n. 1
0
 public Models.DbModels.appcategory GetCategoryInfo(XXF.Db.DbConn PubConn, int typeid, int categoryid)
 {
     string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype  and categoryid=@categoryid";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", typeid);
     para.Add("@categoryid", categoryid);
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     if (ds.Tables[0].Rows.Count == 0)
         return null;
     DataRow dr = ds.Tables[0].Rows[0];
     DbModels.appcategory item = new DbModels.appcategory();
     item.apptype = Convert.ToInt32(dr["apptype"]);
     item.categoryid = Convert.ToInt32(dr["categoryid"]);
     item.categorytitle = dr["categorytitle"].ToString();
     item.categorydesc = dr["categorydesc"].ToString();
     return item;
 }
Esempio n. 2
0
 public List<Models.DbModels.appcategory> GetAppTypeCategorys(XXF.Db.DbConn PubConn, int typeid)
 {
     List<DbModels.appcategory> listmodel = new List<DbModels.appcategory>();
     string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype order by categoryid asc";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", typeid);
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     foreach (DataRow dr in ds.Tables[0].Rows)
     {
         DbModels.appcategory item = new DbModels.appcategory();
         item.apptype = Convert.ToInt32(dr["apptype"]);
         item.categoryid = Convert.ToInt32(dr["categoryid"]);
         item.categorytitle = dr["categorytitle"].ToString();
         item.categorydesc = dr["categorydesc"].ToString();
         listmodel.Add(item);
     }
     return listmodel;
 }
Esempio n. 3
0
        public List <Models.DbModels.appcategory> GetAppTypeCategorys(XXF.Db.DbConn PubConn, int typeid)
        {
            List <DbModels.appcategory> listmodel = new List <DbModels.appcategory>();
            string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype order by categoryid asc";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", typeid);
            DataSet ds = new DataSet();

            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                DbModels.appcategory item = new DbModels.appcategory();
                item.apptype       = Convert.ToInt32(dr["apptype"]);
                item.categoryid    = Convert.ToInt32(dr["categoryid"]);
                item.categorytitle = dr["categorytitle"].ToString();
                item.categorydesc  = dr["categorydesc"].ToString();
                listmodel.Add(item);
            }
            return(listmodel);
        }
Esempio n. 4
0
        public Models.DbModels.appcategory GetCategoryInfo(XXF.Db.DbConn PubConn, int typeid, int categoryid)
        {
            string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype  and categoryid=@categoryid";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", typeid);
            para.Add("@categoryid", categoryid);
            DataSet ds = new DataSet();

            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            if (ds.Tables[0].Rows.Count == 0)
            {
                return(null);
            }
            DataRow dr = ds.Tables[0].Rows[0];

            DbModels.appcategory item = new DbModels.appcategory();
            item.apptype       = Convert.ToInt32(dr["apptype"]);
            item.categoryid    = Convert.ToInt32(dr["categoryid"]);
            item.categorytitle = dr["categorytitle"].ToString();
            item.categorydesc  = dr["categorydesc"].ToString();
            return(item);
        }