public Maticsoft.Model.DishesEntity GetDishes(DishesTyep dishesTyep, IDishSiteModel dishSiteModel) { var dishes = new Maticsoft.Model.DishesEntity(); dishes.DishesID = Guid.NewGuid().ToString(); dishes.DishesName = dishSiteModel.DishName; dishes.DishesTypeID = dishesTyep.DishesTypeID; dishes.DishesBrief = dishSiteModel.DishesBrief; dishes.DishesMoney = GetDishesMoney(dishSiteModel); dishes.DishesUnit = dishSiteModel.DishesUnit; if (string.IsNullOrWhiteSpace(dishes.DishesName)) { dishes.IsNull = true; } if (dishes.DishesMoney == 0) { dishes.IsCurrentPrice = true; } return dishes; }
public virtual string GetDishUrl(DishesTyep dishType) { return dishType.DishHref; }
public Maticsoft.Model.DishesEntity GetDishes(DishesTyep dishesTyep, HtmlNode dishesNode) { var dishes = new Maticsoft.Model.DishesEntity(); dishes.DishesID = Guid.NewGuid().ToString(); dishes.DishesName = GetDishesName(dishesNode); dishes.DishesTypeID = dishesTyep.DishesTypeID; dishes.PictureHref = GetPictureHref(dishesNode); dishes.DishesBrief = GetDishesBrief(dishesNode); dishes.DishesMoney = GetDishesMoney(dishesNode); dishes.DishesUnit = GetDishesUnit(dishesNode); if (string.IsNullOrWhiteSpace(dishes.DishesName)) { dishes.IsNull = true; } if (dishes.DishesMoney == 0) { dishes.IsCurrentPrice = true; } return dishes; }
/// <summary> /// 得到一个对象实体 /// </summary> public Maticsoft.Model.DishesTyep DataRowToModel(DataRow row) { Maticsoft.Model.DishesTyep model=new Maticsoft.Model.DishesTyep(); if (row != null) { if(row["DishesTypeID"]!=null) { model.DishesTypeID=row["DishesTypeID"].ToString(); } if(row["DishesTypeName"]!=null) { model.DishesTypeName=row["DishesTypeName"].ToString(); } if(row["OldDishesTypeID"]!=null) { model.OldDishesTypeID=row["OldDishesTypeID"].ToString(); } if(row["BusinessID"]!=null) { model.BusinessID=row["BusinessID"].ToString(); } if(row["SortID"]!=null && row["SortID"].ToString()!="") { model.SortID=int.Parse(row["SortID"].ToString()); } if(row["CreateDate"]!=null && row["CreateDate"].ToString()!="") { model.CreateDate=DateTime.Parse(row["CreateDate"].ToString()); } if(row["ChainStoreDishesTypeID"]!=null) { model.ChainStoreDishesTypeID=row["ChainStoreDishesTypeID"].ToString(); } if(row["ChainStoreID"]!=null) { model.ChainStoreID=row["ChainStoreID"].ToString(); } if(row["IsDeleted"]!=null && row["IsDeleted"].ToString()!="") { if((row["IsDeleted"].ToString()=="1")||(row["IsDeleted"].ToString().ToLower()=="true")) { model.IsDeleted=true; } else { model.IsDeleted=false; } } if(row["IsSetMeal"]!=null && row["IsSetMeal"].ToString()!="") { if((row["IsSetMeal"].ToString()=="1")||(row["IsSetMeal"].ToString().ToLower()=="true")) { model.IsSetMeal=true; } else { model.IsSetMeal=false; } } } return model; }
/// <summary> /// 得到一个对象实体 /// </summary> public Maticsoft.Model.DishesTyep GetModel(string DishesTypeID) { StringBuilder strSql=new StringBuilder(); strSql.Append("select top 1 DishesTypeID,DishesTypeName,OldDishesTypeID,BusinessID,SortID,CreateDate,ChainStoreDishesTypeID,ChainStoreID,IsDeleted,IsSetMeal from DishesTyep "); strSql.Append(" where DishesTypeID=@DishesTypeID "); SqlParameter[] parameters = { new SqlParameter("@DishesTypeID", SqlDbType.NVarChar,50) }; parameters[0].Value = DishesTypeID; Maticsoft.Model.DishesTyep model=new Maticsoft.Model.DishesTyep(); DataSet ds=ServerDbHelperSQL.Query(strSql.ToString(),parameters); if(ds.Tables[0].Rows.Count>0) { return DataRowToModel(ds.Tables[0].Rows[0]); } else { return null; } }
public virtual string GetDishUrl(DishesTyep dishType, ref int pageNum) { return dishType.DishHref; }