void btnSave_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtSupTypeName.Text) && !string.IsNullOrEmpty(this.txtSupTypeCode.Text)) { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { //检查唯一性 var temp = db.ManufacturerType.SingleOrDefault(a => a.ManufacturerTypeCode == this.txtSupTypeCode.Text.Trim()); if (temp == null) { ManufacturerType ei = new ManufacturerType(); ei.ManufacturerTypeName = this.txtSupTypeName.Text.Trim(); ei.ManufacturerTypeCode = this.txtSupTypeCode.Text.Trim(); ei.Remark = this.txtRemark.Text.Trim(); db.ManufacturerType.InsertOnSubmit(ei); db.SubmitChanges(); Response.Redirect("ManufacturerTypeManager.aspx"); } else { ClientScript.RegisterClientScriptBlock(typeof(string), "ShowMessage", "<script>alert('类别编码已存在')</script>"); } } } }
public async Task <IActionResult> PutManufacturerType(Guid id, ManufacturerType manufacturerType) { if (id != manufacturerType.TypeId) { return(BadRequest()); } _context.Entry(manufacturerType).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ManufacturerTypeExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public ActionResult DeleteConfirmed(long id) { ManufacturerType manufacturertype = db.ManufacturerTypes.Find(id); db.ManufacturerTypes.Remove(manufacturertype); db.SaveChanges(); return(RedirectToAction("Index")); }
public IQueryable <GraphicCard> GetGraphicCardsForApi(string memoryType, string brand, string manufacturer) { GraphicCardMemoryType graphicCardMemoryType = (GraphicCardMemoryType)Enum.Parse(typeof(GraphicCardMemoryType), memoryType); GraphicCardManufacturerType graphicCardManufacturerType = (GraphicCardManufacturerType)Enum.Parse(typeof(GraphicCardManufacturerType), brand); ManufacturerType manufacturerType = (ManufacturerType)Enum.Parse(typeof(ManufacturerType), manufacturer); return(this.Context.GraphicCards.Where(gc => gc.MemoryType == graphicCardMemoryType && gc.Brand == graphicCardManufacturerType && gc.Manufacturer == manufacturerType)); }
public ActionResult Edit(ManufacturerType manufacturertype) { if (ModelState.IsValid) { db.Entry(manufacturertype).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manufacturertype)); }
public GSM(Models model, ManufacturerType manufacturer, double? price, Battery battery, Display display) : this(model, manufacturer) { if (price.HasValue) this.price = price.Value; if(battery != null) this.Battery = battery; if (display != null) this.Display = display; }
// // GET: /ManufacturerType/Delete/5 public ActionResult Delete(long id = 0) { ManufacturerType manufacturertype = db.ManufacturerTypes.Find(id); if (manufacturertype == null) { return(HttpNotFound()); } return(View(manufacturertype)); }
public ActionResult Create(ManufacturerType manufacturertype) { if (ModelState.IsValid) { db.ManufacturerTypes.Add(manufacturertype); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(manufacturertype)); }
public ComputerFactory GetManufacturer(ManufacturerType type) { switch (type) { case ManufacturerType.Dell: return new Dell(); case ManufacturerType.HP: return new HP(); case ManufacturerType.Lenovo: return new Lenovo(); default: throw new InvalidArgumentException("Invalid manufacturer!"); } }
/// <inheritdoc/> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { ManufacturerType pos = (ManufacturerType)value; switch (pos) { default: case ManufacturerType.Head: return(Brushes.LightGreen); case ManufacturerType.Atomic: return(Brushes.Salmon); case ManufacturerType.Rossignol: return(Brushes.LightGray); } }
public GSM(Models model, ManufacturerType manufacturer, double?price, Battery battery, Display display) : this(model, manufacturer) { if (price.HasValue) { this.price = price.Value; } if (battery != null) { this.Battery = battery; } if (display != null) { this.Display = display; } }
void InsertRow() { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { ManufacturerType ei = db.ManufacturerType.SingleOrDefault(a => a.ManufacturerTypeID == int.Parse(Request.QueryString["ManufacturerTypeID"])); if (ei != null) { ei.ManufacturerTypeName = this.txtSupTypeName.Text.Trim(); ei.ManufacturerTypeCode = this.txtSupTypeCode.Text.Trim(); ei.Remark = this.txtRemark.Text.Trim(); db.SubmitChanges(); Response.Redirect("ManufacturerTypeManager.aspx"); } } }
private async Task <SupplierProduct> ConstructProduct(ProductBusinessModel product) { //Construct Product Data Model var productDto = new Product(); productDto.Name = product.BrandName; productDto.BrandName = product.BrandName; productDto.GenericName = product.GenericName; productDto.INNID = product.INNID; productDto.DosageFormID = product.DosageFormID; productDto.DosageStrengthID = product.DosageStrengthID; productDto.DosageUnitID = product.DosageUnitID; productDto.RowGuid = System.Guid.NewGuid(); productDto.CreatedByUserID = product.CreatedByUserID; //Load product type from code ProductType productType = await _productTypeService.GetAsync(mt => mt.ProductTypeCode == product.ProductTypeCode); productDto.ProductTypeID = productType.ID; //Construct product manufacturer ManufacturerType finishedGoodManufacturer = await _manufacturerTypeService.GetAsync(mt => mt.ManufacturerTypeCode == "FIN_PROD_MANUF"); productDto.ProductManufacturers = new List <ProductManufacturer> () { new ProductManufacturer() { ManufacturerAddressID = product.ManufacturerAddressID, ManufacturerTypeID = finishedGoodManufacturer?.ID } }; //Construct Product Presentation productDto.Presentations = product.Presentations; //Construct Product MD presentation if product type is medical device productDto.MDModelSizes = product.MDModelSizes; //Construct Supplier Product SupplierProduct supProduct = new SupplierProduct() { SupplierID = product.SupplierID, Product = productDto }; return(supProduct); }
public ComputerFactory GetManufacturer(ManufacturerType type) { switch (type) { case ManufacturerType.Dell: return(new Dell()); case ManufacturerType.HP: return(new HP()); case ManufacturerType.Lenovo: return(new Lenovo()); default: throw new InvalidArgumentException("Invalid manufacturer!"); } }
static void Main(string[] args) { var cont = new PcBuilder_DevContext(); var js = System.IO.File.ReadAllText(@"C:\Users\gnikoleishvili\Desktop\Document\PcBuilder\PcBuilder\StaticDataRunner\Data\Memory\Manufacturer\Manufacturer.json"); var data = JsonConvert.DeserializeObject <List <CommonModel> >(js); foreach (var item in data) { var entity = new ManufacturerType { Name = item.Name.Trim(), HardwareTypeId = 1005 }; cont.ManufacturerType.Add(entity); } cont.SaveChanges(); }
internal void AdvancedSearch() { SearchProductMenu.Click(); ResidentialMenu.Click(); AirConditionersandHeatPumpsMenu.Click(); HeatPumpsAndHeatPumpCoils.Click(); ManufacturerType.SelectByIndex(1); SearchButton.Click(); Assert.IsTrue(Utility.SearchResultsTableRowCount() > 1); Utility.DoesFileExist(); FirstResultInTheTable.Click(); try { wait.Until(Driver => Utility.DoesFileExist()); } catch (Exception) { Assert.Fail("Unable to download the file"); } }
public async Task <ActionResult <ManufacturerType> > PostManufacturerType(ManufacturerType manufacturerType) { _context.ManufacturerTypes.Add(manufacturerType); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (ManufacturerTypeExists(manufacturerType.TypeId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetManufacturerType", new { id = manufacturerType.TypeId }, manufacturerType)); }
private void BindData() { int intID = 0; if (int.TryParse(Request.QueryString["ManufacturerTypeID"], out intID)) { using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { ManufacturerType di = db.ManufacturerType.SingleOrDefault(a => a.ManufacturerTypeID == intID); if (di != null) { this.txtSupTypeName.Text = di.ManufacturerTypeName; this.txtSupTypeCode.Text = di.ManufacturerTypeCode; this.txtRemark.Text = di.Remark; } } } else { Response.Redirect("ManufacturerTypeManager.aspx"); } }
public GSM(Models model, ManufacturerType manufacturer) { this.Model = model; this.Manufacturer = manufacturer; }
public void Add(ManufacturerType entity) { throw new System.NotImplementedException(); }
public void SetValues(ManufacturerType dest, ManufacturerType chng) { throw new System.NotImplementedException(); }
public Sweet(ManufacturerType manufacturer, int weight, int sugarPercentage) { Manufacturer = manufacturer; Weight = weight; SugarPercentage = sugarPercentage; }
private string InsertData(Net.SourceForge.Koogra.Excel.Row row) { string strResult = ""; using (MMSProDBDataContext db = new MMSProDBDataContext(ConfigurationManager.ConnectionStrings["mmsConString"].ConnectionString)) { //检查生产厂商类别 if (row.Cells[0] == null || row.Cells[1] == null) { return("生产厂商类别信息不完整"); } //写入生产厂商类别信息 ManufacturerType mft; //检查生产厂商类别是否存在 if (!db.ManufacturerType.Any(a => a.ManufacturerTypeCode == row.Cells[0].Value.ToString())) { mft = new ManufacturerType(); //MT.MaterialMainTypeCode = mft.ManufacturerTypeCode = row.Cells[0].Value.ToString(); mft.ManufacturerTypeName = row.Cells[1].Value.ToString(); mft.Remark = row.Cells[2] == null ? "" : row.Cells[2].Value.ToString(); db.ManufacturerType.InsertOnSubmit(mft); db.SubmitChanges(); } else { mft = db.ManufacturerType.SingleOrDefault(a => a.ManufacturerTypeCode == row.Cells[0].Value.ToString()); mft.ManufacturerTypeCode = row.Cells[0].Value.ToString(); mft.ManufacturerTypeName = row.Cells[1].Value.ToString(); mft.Remark = row.Cells[2] == null ? "" : row.Cells[2].Value.ToString(); db.SubmitChanges(); } //*************************************************************************** //写入生产厂商信息 if (row.Cells[3] == null || row.Cells[4] == null) { return("生产厂商信息不完整"); } //写入生产厂商类别信息 Manufacturer mf; //检查生产厂商类别是否存在 if (!db.Manufacturer.Any(a => a.ManufacturerCode == row.Cells[3].Value.ToString())) { mf = new Manufacturer(); //MT.MaterialMainTypeCode = mf.ManufacturerCode = row.Cells[3].Value.ToString(); mf.ManufacturerName = row.Cells[4].Value.ToString(); mf.Remark = row.Cells[5] == null ? "" : row.Cells[5].Value.ToString(); mf.ManufacturerTypeID = mft.ManufacturerTypeID; db.Manufacturer.InsertOnSubmit(mf); db.SubmitChanges(); } else { mf = db.Manufacturer.SingleOrDefault(a => a.ManufacturerCode == row.Cells[3].Value.ToString()); mf.ManufacturerCode = row.Cells[3].Value.ToString(); mf.ManufacturerName = row.Cells[4].Value.ToString(); mf.ManufacturerTypeID = mft.ManufacturerTypeID; mf.Remark = row.Cells[5] == null ? "" : row.Cells[5].Value.ToString(); db.SubmitChanges(); } } return(strResult); }
public GlazedCandy(FillingType filling, ManufacturerType manufacturer, int weight, int sugar) : base(manufacturer, weight, sugar) { Filling = filling; }
public Caramel(int syrupPercentage, ManufacturerType manufacturer, int weight, int sugar) : base(manufacturer, weight, sugar) { SyrupPercentage = syrupPercentage; }
public Cookie(int chocolatePercentage, ManufacturerType manufacturer, int weight, int sugar) : base(manufacturer, weight, sugar) { ChocolatePercentage = chocolatePercentage; }
public Chocolate(ChocolateType chocolateType, ManufacturerType manufacturer, int weight, int sugar) : base(manufacturer, weight, sugar) { ChocolateType = chocolateType; }
public Candy(ManufacturerType manufacturer, int weight, int sugarPercentage) : base (manufacturer, weight, sugarPercentage) { }
public Waffle(WaffleType waffleType, ManufacturerType manufacturer, int weight, int sugar) : base(manufacturer, weight, sugar) { WaffleType = waffleType; }