public static string SelectCategory() { FormSelectPackage form = new FormSelectPackage(); form.Search(); form.ShowDialog(); return(form.selectedItem); }
private void buttonAddCategoryClickedCallback() { string packageName = FormSelectPackage.SelectCategory(); if (packageName == null) { return; } using (WMSEntities wmsEntities = new WMSEntities()) { Supply[] supplies = (from s in wmsEntities.Supply where s.ProjectID == this.projectID && s.WarehouseID == this.warehouseID && s.IsHistory != 1 && s.Package == packageName select s).ToArray(); Dictionary <string, string> keyConvert = new Dictionary <string, string>(); keyConvert.Add("SupplyNoOrComponentName", "No"); keyConvert.Add("ShipmentAmount", "PackageDefaultShipmentAmount"); keyConvert.Add("Unit", "PackageDefaultShipmentUnit"); keyConvert.Add("UnitAmount", "PackageDefaultShipmentUnitAmount"); this.standardImportForm.PushData(supplies, keyConvert, true); } }