public void GetsBrand() { BrandManager brandManager = new BrandManager(new EfBrandDal()); brandManager.GetBrands(); foreach (var brands in brandManager.GetBrands()) { Console.WriteLine("{0},{1}", brands.BrandId, brands.BrandName); } }
private static void BrandTest() { BrandManager brandManager = new BrandManager(new EfBrandDal()); foreach (var brand in brandManager.GetAll().Data) { Console.WriteLine(brand.BrandName); } brandManager.Add(new Brand { BrandName = "Fiat" }); Brand brand1 = new Brand() { BrandName = "Ford", }; brandManager.Add(brand1); brandManager.Delete(new Brand { BrandId = 1006 }); brandManager.Update(new Brand { BrandId = 2, BrandName = "Dacia" }); brandManager.Update(new Brand { BrandId = 1, BrandName = "Mercedes", }); foreach (var b in brandManager.GetBrands("Mercedes").Data) { Console.WriteLine(b.BrandId); } }
private static void BrandTest(BrandManager brandManager) { foreach (var brand in brandManager.GetBrands().Data) { Console.WriteLine(brand.BrandName); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Request.QueryString["BrandId"] != null) { int BrandId = Convert.ToInt32(Request.QueryString["BrandId"]); dvBrand.DataSource = bm.GetBrands(); dvBrand.DataBind(); } else { lblInfo.Text = "BrandId字段为空"; } } }
private static void ListAllBrands(BrandManager brandManager) { Console.WriteLine("-----Markalar-----"); foreach (var brand in brandManager.GetBrands().Data) { Console.WriteLine("{0} / {1}", brand.Id, brand.Name); } }
public void GetBrandsTest() { List <Brand> list = bm.GetBrands(); foreach (var item in list) { Debug.WriteLine(item.BrandName); } }
public List <Brand> bindBrands() { try { return(bm.GetBrands()); } catch (Exception) { throw; } }
public List <CarSYSModels.Brand> bindBrands() { try { return(bm.GetBrands()); } catch (Exception ex) { throw; } }
public void bindBrand() { try { gvBrand.DataSource = bm.GetBrands(); gvBrand.DataBind(); } catch (Exception ex) { lblInfo.Text = "绑定失败,出现异常:" + ex.Message; } }
public List <Brand> bindBrands() { List <Brand> brands = new List <Brand>(); try { brands = bm.GetBrands(); } catch (Exception) { throw; } return(brands); }
public List <Brand> bindBrands() { List <Brand> brands = null; try { brands = bm.GetBrands(); } catch (Exception ex) { lblInfo.Text = ex.Message; } return(brands); }
public void bindBrand() { try { ddlBrand.DataSource = bm.GetBrands(); ddlBrand.DataValueField = "BrandId"; ddlBrand.DataTextField = "BrandName"; ddlBrand.DataBind(); ddlBrand.Items.Insert(0, new ListItem("请选择", "-1")); } catch (Exception ex) { lblInfo.Text = "绑定品牌失败,出现异常,异常信息:" + ex.Message; } }
public void bindBrands() { try { ddlBrand.DataSource = bm.GetBrands(); ddlBrand.DataTextField = "BrandId"; ddlBrand.DataValueField = "BrandName"; ddlBrand.DataBind(); ddlBrand.Items.Insert(0, new ListItem("请选择", "-1")); } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "", "alert('" + ex.Message + "')", true); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { try { List <Brand> brands = bm.GetBrands(); ddlBrand.DataSource = brands; ddlBrand.DataTextField = "BrandName"; ddlBrand.DataValueField = "BrandId"; ddlBrand.DataBind(); ddlBrand.Items.Insert(0, new ListItem("请选择", "-1")); } catch (Exception ex) { Response.Write(ex.Message); } } }
public IHttpActionResult GetBrands() { BrandManager brandManager = new BrandManager(); return(Ok(brandManager.GetBrands())); }