Esempio n. 1
0
        private static List <HealthItemList> GetAllHealthItemListBySql(string strsql)
        {
            DataTable             dt = DBHelper.GetTable(strsql);
            List <HealthItemList> AllHealthItemList = new List <HealthItemList>();

            foreach (DataRow row in dt.Rows)
            {
                HealthItemList hl = new HealthItemList();
                hl.ItemListld   = Convert.ToInt32(row["ItemListld"]);
                hl.ItemListName = row["ItemListName"].ToString();
                hl.ItemTypeld   = Convert.ToInt32(row["ItemListld"]);
                string iss = row["IsGood"].ToString();
                if (iss == "True")
                {
                    hl.IsGood = "是";
                }
                else
                {
                    hl.IsGood = "否";
                }
                hl.Price    = Convert.ToDouble(row["Price"]);
                hl.Standard = row["Standard"].ToString();
                hl.Info     = row["Info"].ToString();
                hl.Heath    = HealthTypeItemService.GetHealthTypeItemByID(Convert.ToInt32(row["ItemTypeld"]));
                AllHealthItemList.Add(hl);
            }
            return(AllHealthItemList);
        }
Esempio n. 2
0
        //根据id查询
        public static HealthTypeItem GetHealthTypeItemByID(int ItemTypeld)
        {
            string strsql = "select * from HealthTypeItem where ItemTypeld=" + ItemTypeld;

            return(HealthTypeItemService.GetHealthTypeItemBySql(strsql)[0]);
        }