/// <summary> /// Create a new cg_Products_Info object. /// </summary> /// <param name="productInfoId">Initial value of the ProductInfoId property.</param> /// <param name="productId">Initial value of the ProductId property.</param> /// <param name="languageId">Initial value of the LanguageId property.</param> /// <param name="title">Initial value of the Title property.</param> /// <param name="shortDescription">Initial value of the ShortDescription property.</param> /// <param name="description">Initial value of the Description property.</param> /// <param name="status">Initial value of the Status property.</param> public static cg_Products_Info Createcg_Products_Info(global::System.Int64 productInfoId, global::System.Int64 productId, global::System.Int64 languageId, global::System.String title, global::System.String shortDescription, global::System.String description, global::System.String status) { cg_Products_Info cg_Products_Info = new cg_Products_Info(); cg_Products_Info.ProductInfoId = productInfoId; cg_Products_Info.ProductId = productId; cg_Products_Info.LanguageId = languageId; cg_Products_Info.Title = title; cg_Products_Info.ShortDescription = shortDescription; cg_Products_Info.Description = description; cg_Products_Info.Status = status; return cg_Products_Info; }
/// <summary> /// Deprecated Method for adding a new object to the cg_Products_Info EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTocg_Products_Info(cg_Products_Info cg_Products_Info) { base.AddObject("cg_Products_Info", cg_Products_Info); }
public ActionResult product_info_add(FormCollection collection) { long ProductId = Convert.ToInt64(collection["ProductId"]); long LanguageId = Convert.ToInt64(collection["LanguageId"]); var item = db.cg_Products.Where(p => p.ProductId == ProductId).FirstOrDefault(); var newItem = new cg_Products_Info(); // add values newItem.Title = collection["Title"]; newItem.ShortDescription = collection["ShortDescription"]; newItem.Description = collection["Description"]; newItem.Status = collection["Status"]; newItem.LanguageId = LanguageId; newItem.cg_ProductsReference.EntityKey = new System.Data.EntityKey("caval_goEntities.cg_Products", "ProductId", ProductId); // add to DB & save db.AddTocg_Products_Info(newItem); db.SaveChanges(); return RedirectToAction("product_infos", new { id = ProductId }); }