Exemplo n.º 1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     String name = TextBox1.Text.Trim();
     using (LiBoClothesShopEntities context = new LiBoClothesShopEntities())
     {
         ColorInfo newObj = new ColorInfo()
         {
             Name = name
         };
         context.AddToColorInfoes(newObj);
         context.SaveChanges();
         Response.Redirect("~/Default.aspx");
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ColorInfoes EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToColorInfoes(ColorInfo colorInfo)
 {
     base.AddObject("ColorInfoes", colorInfo);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new ColorInfo object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static ColorInfo CreateColorInfo(global::System.Int32 id, global::System.String name)
 {
     ColorInfo colorInfo = new ColorInfo();
     colorInfo.Id = id;
     colorInfo.Name = name;
     return colorInfo;
 }