/// <summary> /// Create a new Manufacturer object. /// </summary> /// <param name="manufacturerID">Initial value of the ManufacturerID property.</param> /// <param name="manufacturerName">Initial value of the ManufacturerName property.</param> /// <param name="status">Initial value of the Status property.</param> public static Manufacturer CreateManufacturer(global::System.Int32 manufacturerID, global::System.String manufacturerName, global::System.String status) { Manufacturer manufacturer = new Manufacturer(); manufacturer.ManufacturerID = manufacturerID; manufacturer.ManufacturerName = manufacturerName; manufacturer.Status = status; return manufacturer; }
/// <summary> /// Deprecated Method for adding a new object to the Manufacturers EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToManufacturers(Manufacturer manufacturer) { base.AddObject("Manufacturers", manufacturer); }
protected void btnAddManu_Click(object sender, EventArgs e) { if (txtAddManu.Text == "") { lblAddManuError.Text = "Required"; } else { using (GESEntities db = new GESEntities()) { try { Manufacturer newManufacturer = new Manufacturer(); newManufacturer.ManufacturerName = txtAddManu.Text.ToString(); newManufacturer.ManufacturerDescription = txtAddManu.Text.ToString(); newManufacturer.Status = "Active"; db.Manufacturers.AddObject(newManufacturer); db.SaveChanges(); txtAddManu.Text = ""; lblAddManu.Text = "Added succesfully"; ModelEntityDataSource.WhereParameters.Clear(); ModelEntityDataSource.AutoGenerateWhereClause = true; refreshManufacturerEDS(); lblAddManuError.Text = ""; } catch (Exception exp) { throw new Exception("ERROR: Unable to Add entry - " + exp.Message.ToString(), exp); } } } }