private void PaletteDetailsSaveExecute() { // 0 のときは例外を投げる var paletteDetailsSave = new PaletteDetailsEntity(SelectedPaletteDetails.Value.Paletteid, SelectedPaletteDetails.Value.PaletteDetailsid, SelectedPaletteDetails.Value.AssyNumber, SelectedPaletteDetails.Value.PartsNumber, SelectedPaletteDetails.Value.PartsName, UpdateQuantity.Value, SelectedPaletteDetails.Value.PlaceKey, SelectedPaletteDetails.Value.SubAssemblyKey, _isDeleted); _palettePartsRepository.PaletteDetailsUpdate(paletteDetailsSave); GetPaletteDetails(); GetBom(); }
private void PaletteDetailsAddCommandExecute() { // 0 のときは例外を投げる var paletteDetailsSave = new PaletteDetailsEntity(SelectedPalette.Value.PaletteId, 0, SelectedBom.Value.AssyNumber, SelectedBom.Value.PartsNumber, SelectedBom.Value.PartsName, AddQuantity.Value, _defaultPlaceKey, _defaultSubAssemblyKey, _isDeleted); _palettePartsRepository.PaletteDetailsInsert(paletteDetailsSave); GetPaletteDetails(); GetBom(); AddQuantity.Value = 0; }
public void PaletteDetailsSave(PaletteDetailsEntity paletteDetails) { var parameters = new List <SqlParameter>(); var sql = @" update [KGWS].[dbo].[palette_details] set [parts_quantity]=[parts_quantity]+@parts_quantity where [parts_name]=@parts_name and [parts_quantity]=@parts_quantity "; parameters.Clear(); parameters.Add(new SqlParameter("@parts_number", paletteDetails.PartsNumber)); parameters.Add(new SqlParameter("@parts_name", paletteDetails.PartsName)); parameters.Add(new SqlParameter("@parts_quantity", paletteDetails.PartsQuantity)); SQLServerHelper.Execute(sql, parameters.ToArray()); }
public void PaletteDetailsInsert(PaletteDetailsEntity paletteDetails) { var parameters = new List <SqlParameter>(); var sql = @" insert into [KGWS].[dbo].[palette_details] ( [palette_id] ,[assy_number] ,[parts_number] ,[parts_name] ,[parts_quantity] ,[place_key] ,[subAssembly_key] ,[is_deleted] ) values ( @palette_id ,@assy_number ,@parts_number ,@parts_name ,@parts_quantity ,@place_key ,@subAssembly_key ,@is_deleted ) "; parameters.Clear(); parameters.Add(new SqlParameter("@palette_id", paletteDetails.Paletteid)); parameters.Add(new SqlParameter("@assy_number", paletteDetails.AssyNumber)); parameters.Add(new SqlParameter("@parts_number", paletteDetails.PartsNumber)); parameters.Add(new SqlParameter("@parts_name", paletteDetails.PartsName)); parameters.Add(new SqlParameter("@parts_quantity", paletteDetails.PartsQuantity)); parameters.Add(new SqlParameter("@place_key", paletteDetails.PlaceKey)); parameters.Add(new SqlParameter("@subAssembly_key", paletteDetails.SubAssemblyKey)); parameters.Add(new SqlParameter("@is_deleted", paletteDetails.IsDeleted)); SQLServerHelper.Execute(sql, parameters.ToArray()); }