/// <summary> /// Convert IfcConstructionProductResource to Spare /// </summary> /// <param name="source">IfcConstructionProductResource to convert</param> /// <param name="target">Empty Spare Object</param> /// <returns>Filled Spare Object</returns> protected override Spare Mapping(IIfcConstructionProductResource source, Spare target) { if (Helper == null) { Helper = ((IfcToCOBieLiteUkExchanger)Exchanger).Helper; } if (UsedNames == null) { UsedNames = new List <string>(); } var name = (string.IsNullOrEmpty(source.Name)) ? "Resource" : source.Name.ToString(); //check for duplicates, if found add a (#) => "Name(1)", if none return name unchanged name = Helper.GetNextName(name, UsedNames); target.Name = name; target.CreatedBy = Helper.GetCreatedBy(source); target.CreatedOn = Helper.GetCreatedOn(source); target.Categories = Helper.GetCategories(source, true); //Type name is parent holding the spare list target.Suppliers = GetSuppliers(source); target.ExternalEntity = Helper.ExternalEntityName(source); target.ExternalId = Helper.ExternalEntityIdentity(source); target.AltExternalId = source.GlobalId; target.ExternalSystem = Helper.ExternalSystemName(source); target.Description = GetDescription(source); target.SetNumber = GetSetNumber(source); target.PartNumber = GetPartNumber(source); return(target); }
private bool addImages(Spare spare) { if (spare.images.Length == 0) { return(true); } string providerPath = "/Images/" + spare.provider.id; var connection = DbConnection.openConection(); var imagePaths = new FileArea().saveImages(providerPath, spare.images); try { foreach (var path in imagePaths) { var query = "INSERT INTO `spare_images` (`spare_id`, `image_url`) VALUES ('" + spare.id + "', '" + path + "')"; var cmd = new MySqlCommand(query, connection); cmd.ExecuteNonQuery(); } } catch (Exception e) { Console.WriteLine(e); return(false); } finally { connection.Close(); } return(true); }
public Spare getSpare(string id) { var connection = DbConnection.openConection(); var temp = new Spare(); var query = "SELECT * FROM spares_storage WHERE spares_storage.spare_id = \"" + id + "\""; var cmd = new MySqlCommand(query, connection); var reader = cmd.ExecuteReader(); while (reader.Read()) { temp.id = reader["spare_id"].ToString(); temp.name = reader["spare_name"].ToString(); temp.description = reader["spare_description"].ToString(); temp.price = reader["spare_price"].ToString(); temp.vin = reader["spare_vin"].ToString(); temp.images = getImages(id); temp.carMark = new Markdb().getMark(Int32.Parse(reader["car_mark_id"].ToString())); temp.provider = new Providerdb().getProvider(Int32.Parse(reader["provider_id"].ToString())); temp.category = new Categorydb().getCategory(Int32.Parse(reader["category_id"].ToString())); } connection.Close(); return(temp); }
public void CreateOrUpdate(SpareBindingModel model) { using (var context = new KorytoDatabase()) { Spare element = context.Spares.FirstOrDefault(rec => rec.SpareName == model.SpareName && rec.Id != model.Id); if (element != null) { throw new Exception("Уже есть деталь с таким названием"); } if (model.Id.HasValue) { element = context.Spares.FirstOrDefault(rec => rec.Id == model.Id); if (element == null) { throw new Exception("Элемент не найден"); } } else { element = new Spare(); context.Spares.Add(element); } element.SpareName = model.SpareName; element.Price = model.Price; element.TotalAmount = model.TotalAmount; context.SaveChanges(); } }
public override void Encode() { encodeBuf.Clear(); encodeBuf.AddRange(AddString(DeviceId, 8)); encodeBuf.AddRange(AddString(StationId, 4)); encodeBuf.AddRange(AddString(TxnType, 2)); encodeBuf.AddRange(AddString(TicketRemainAmt.PadLeft(8, '0'), 8)); encodeBuf.AddRange(AddString(Spare.PadLeft(8, '0'), 8)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(TerminalId, 16)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(TerminalFlag, 1)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(LockTime, 14)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(TicketLogicalId, 16)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(TicketPhysicalId, 8)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(TicketMainType, 2)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(TicketSubType, 2)); encodeBuf.AddRange(AddString("\t", 1)); encodeBuf.AddRange(AddString(Spare2.PadLeft(16, '0'), 16)); }
public bool addSpare(Spare spare) { var connection = DbConnection.openConection(); var query = "INSERT INTO `spares_storage` (`spare_id`, `category_id`, `car_mark_id`, `provider_id`,`spare_name`, `spare_description`, `spare_price`, `spare_vin`, `create_date`) VALUES ('" + spare.id + "', '" + spare.category.id + "', '" + spare.carMark.id + "', '" + spare.provider.id + "', '" + spare.name + "', '" + spare.description + "', '" + spare.price + "', '" + spare.vin + "', current_timestamp())"; var cmd = new MySqlCommand(query, connection); try { cmd.ExecuteNonQuery(); } catch { return(false); } finally { connection.Close(); } return(addImages(spare)); }
protected override void UpdateFrameOutcome(Queue <int> rolls) { if (_pinsRemaining == 0) { if (Turns.Count < _maxTurns) { FrameOutcome = new Strike(); } else { FrameOutcome = new Spare(); } } else { if (Turns.Count < _maxTurns) { PlayFrame(rolls); } else { FrameOutcome = new OpenFrame(); } } }
public bool CreateSpare(Spare spare) { spare.DateAdded = DateTime.Now; context.Add(spare); context.SaveChanges(); return(true); }
public bool CheckSpareCodeExist(Spare spare) { try { using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[PSA].[CheckSpareCodeExist]"; cmd.Parameters.Add("@Code", SqlDbType.NVarChar).Value = spare.Code; cmd.Parameters.Add("@ID", SqlDbType.UniqueIdentifier).Value = spare.ID; cmd.CommandType = CommandType.StoredProcedure; Object res = cmd.ExecuteScalar(); return(res.ToString() == "Exists" ? true : false); } } } catch (Exception ex) { throw ex; } }
public void SpareTest() { var controller = new UsersController(); //Initialize spare's provider, category, car mark var provider = new Provider(); provider.username = "******"; provider.password = "******"; provider.email = "*****@*****.**"; provider.phone = "+79117366548"; provider.role = new Role(2, "provider"); provider.address = "Random Address"; provider.name = "Random Name"; var createProvider = controller.Post(provider); Assert.IsNotNull(createProvider); Provider readProvider = (Provider)controller.Get(createProvider.username); var categories = new CategoriesController().Get().ToArray(); var marks = new MarksController().Get().ToArray(); var sparesController = new SparesController(); //Initialize new spare var spare = new Spare(); spare.id = "some-unique-id-required"; spare.category = categories[0]; spare.carMark = marks[0]; spare.name = "dummyName"; spare.description = "dummy description"; spare.price = "500$"; spare.vin = "R34TF6"; spare.provider = readProvider; spare.images = new List <Img>().ToArray(); //Test adding spare to database var isAdded = sparesController.Post(spare); Assert.IsTrue(isAdded); //Test updating spare in database spare.category = categories[1]; var isUpdated = sparesController.Put(spare.id, spare); Assert.IsTrue(isUpdated); //Test deleting spare from database var deleted = sparesController.Delete(spare.id); Assert.IsTrue(deleted); //Removing spare's provider from database var providerDeleted = controller.Delete(readProvider.username); Assert.IsTrue(providerDeleted); //Test controller returns list of spares var spares = sparesController.Get(); Assert.IsNotNull(spares); }
public bool DeleteSpare(int spareId) { Spare spare = context.Spares.Where(x => x.Id == spareId).FirstOrDefault(); spare.IsDelete = true; context.SaveChanges(); return(true); }
public List <Spare> GetAllSpare(SpareAdvanceSearch spareAdvanceSearch) { List <Spare> spareList = null; try { using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[PSA].[GetAllSpare]"; cmd.Parameters.Add("@SearchValue", SqlDbType.NVarChar, -1).Value = string.IsNullOrEmpty(spareAdvanceSearch.SearchTerm) ? "" : spareAdvanceSearch.SearchTerm; cmd.Parameters.Add("@RowStart", SqlDbType.Int).Value = spareAdvanceSearch.DataTablePaging.Start; if (spareAdvanceSearch.DataTablePaging.Length == -1) { cmd.Parameters.AddWithValue("@Length", DBNull.Value); } else { cmd.Parameters.Add("@Length", SqlDbType.Int).Value = spareAdvanceSearch.DataTablePaging.Length; } cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader sdr = cmd.ExecuteReader()) { if ((sdr != null) && (sdr.HasRows)) { spareList = new List <Spare>(); while (sdr.Read()) { Spare spare = new Spare(); { spare.ID = (sdr["ID"].ToString() != "" ? Guid.Parse(sdr["ID"].ToString()) : spare.ID); spare.Code = (sdr["Code"].ToString() != "" ? sdr["Code"].ToString() : spare.Code); spare.Name = (sdr["Name"].ToString() != "" ? sdr["Name"].ToString() : spare.Name); spare.HSNCode = (sdr["HSNCode"].ToString() != "" ? sdr["HSNCode"].ToString() : spare.HSNCode); spare.TotalCount = (sdr["TotalCount"].ToString() != "" ? int.Parse(sdr["TotalCount"].ToString()) : spare.TotalCount); spare.FilteredCount = (sdr["FilteredCount"].ToString() != "" ? int.Parse(sdr["FilteredCount"].ToString()) : spare.FilteredCount); } spareList.Add(spare); } } } } } } catch (Exception ex) { throw ex; } return(spareList); }
private void GetSelectedSpareObject(ref Spare _selectedSpareForEdit, object sender) { _selectedSpareForEdit.SparePuchaseId = ((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).SparePuchaseId; _selectedSpareForEdit.SpareName = ((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).SpareName.ToString(); _selectedSpareForEdit.SparePartCode = ((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).SparePartCode.ToString(); _selectedSpareForEdit.Quantity = int.Parse(((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).Quantity.ToString()); _selectedSpareForEdit.SpareUnitPriceForSale = float.Parse(((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).SpareUnitPriceForSale.ToString()); _selectedSpareForEdit.SubTotal = float.Parse(((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).SubTotal.ToString()); //_selectedSpareForEdit.supplierName = ((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).supplierName.ToString(); _selectedSpareForEdit.SparePartDescription = ((EntitiesLayer.Entities.Spare)(((System.Windows.Controls.DataGrid)(sender)).CurrentItem)).SparePartDescription.ToString(); }
private void ExecuteEdit(object parameter) { if (_dbContext is SQLiteContext) { SQLiteContext context = _dbContext as SQLiteContext; Spare spare = context.Spare.Where(s => s.Rowid == _spare.Rowid).SingleOrDefault(); spare.Name = Name; spare.Description = Description; context.SaveChanges(); context.Configuration.LazyLoadingEnabled = true; context.Database.Initialize(true); } }
public void SpareTest() { List <int> balls = new List <int>(); Spare frame = new Spare(1); frame.AddBalls(ref balls); balls.Add(2); Assert.Equal(12, frame.Score); Assert.Equal <int>(new int[] { 1, 9 }, frame.PinsPerBall); Assert.Equal <int>(new int[] { 1, 9, 2 }, balls); }
/// <summary> /// Generate the serial number string based off the serial number /// values. /// </summary> /// <returns>String of the serial number.</returns> private string GetSerialNumberString() { StringBuilder result = new StringBuilder(); // Base Electronics if (string.IsNullOrEmpty(BaseHardware)) { result.Append("00"); } else { result.Append(BaseHardware.PadLeft(BASE_HDWR_NUM_BYTES, '0')); } // Subsystems if (string.IsNullOrEmpty(SubSystems)) { result.Append("000000000000000"); } else { // Set the subsystems, padding the end with 0's result.Append(SubSystems.PadRight(SUBSYSTEM_NUM_BYTES, '0')); } // Spare if (string.IsNullOrEmpty(Spare)) { result.Append("000000000"); } else { result.Append(Spare.PadRight(SPARE_NUM_BYTES, '0')); } // Serial number if (SystemSerialNumber == EMPTY_SERIAL_NUM) { result.Append("000000"); } else { string serial = SystemSerialNumber.ToString(); result.Append(serial.PadLeft(SERIAL_NUM_BYTES, '0')); } return(result.ToString()); }
public bool UpdateSpare(Spare spares) { Spare sp = context.Spares.Where(x => x.Id == spares.Id).FirstOrDefault(); sp.Article = spares.Article; sp.DateAdded = spares.DateAdded; sp.Description = spares.Description; sp.IsDelete = spares.IsDelete; sp.NameSpare = spares.NameSpare; sp.Photo = spares.Photo; sp.Price = spares.Price; sp.TypeSpareId = spares.TypeSpareId; context.SaveChanges(); return(true); }
public EditSpareVM(long rowid) { Name = String.Empty; Description = String.Empty; var sdbContext = SingletonDBContext.GetInstance(new SQLiteContext()); _dbContext = sdbContext.DBContext; if (_dbContext is SQLiteContext) { var context = _dbContext as SQLiteContext; _spare = context.Spare.Where(s => s.Rowid == rowid).SingleOrDefault(); Name = _spare.Name; Description = _spare.Description; } }
public Vector3 GetDockedPosition(VEntity docked, Spare part) { Vector3 p; switch (part) { case Spare.Overhead: p = docked.graphic.spare.overheadPos; break; case Spare.HitPoint: p = docked.graphic.spare.hitPointPos; break; case Spare.LHand: p = docked.graphic.spare.lHandPos; break; case Spare.RHand: p = docked.graphic.spare.rHandPos; break; case Spare.LFoot: p = docked.graphic.spare.lFootPos; break; case Spare.RFoot: p = docked.graphic.spare.rFootPos; break; case Spare.HeadNub: p = docked.graphic.spare.headNubPos; break; case Spare.Weapon0: p = docked.graphic.spare.weapon0Pos; break; case Spare.Weapon1: p = docked.graphic.spare.weapon1Pos; break; default: p = docked.graphic.spare.footholdPos; break; } return(p); }
private void ExecuteAdd(object parameter) { Spare spare = new Spare() { Name = this.Name, Description = this.Description }; if (_dbContext is SQLiteContext) { SQLiteContext context = _dbContext as SQLiteContext; context.Spare.Add(spare); context.SaveChanges(); context.Configuration.LazyLoadingEnabled = true; context.Database.Initialize(true); } }
public static List<IFrame> GetScoresForAllSparesWithZeroNextScore() { var frames = new List<IFrame>(); IFrame previousFrame = null; for (var i = 0; i < 10; i++) { var spare = new Spare(0, 10, previousFrame); frames.Add(spare); previousFrame = spare; } frames.Add(new BonusFrame(0, 10, 11, previousFrame)); return frames; }
public void Delete(SpareBindingModel model) { using (var context = new KorytoDatabase()) { Spare element = context.Spares.FirstOrDefault(rec => rec.Id == model.Id); if (element != null) { context.Spares.Remove(element); context.SaveChanges(); } else { throw new Exception("Элемент не найден"); } } }
public List <Spare> GetSpareForSelectList() { List <Spare> spareList = null; try { using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[PSA].[GetSpareForSelectList]"; cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader sdr = cmd.ExecuteReader()) { if ((sdr != null) && (sdr.HasRows)) { spareList = new List <Spare>(); while (sdr.Read()) { Spare spare = new Spare(); { spare.ID = (sdr["ID"].ToString() != "" ? Guid.Parse(sdr["ID"].ToString()) : spare.ID); spare.Code = (sdr["Code"].ToString() != "" ? (sdr["Code"].ToString()) : spare.Code); spare.Name = (sdr["Name"].ToString() != "" ? (sdr["Name"].ToString()) : spare.Name); } spareList.Add(spare); } } } } } } catch (Exception ex) { throw ex; } return(spareList); }
public Spare GetSpare(Guid id) { Spare spare = null; try { using (SqlConnection con = _databaseFactory.GetDBConnection()) { using (SqlCommand cmd = new SqlCommand()) { if (con.State == ConnectionState.Closed) { con.Open(); } cmd.Connection = con; cmd.CommandText = "[PSA].[GetSpare]"; cmd.Parameters.Add("@ID", SqlDbType.UniqueIdentifier).Value = id; cmd.CommandType = CommandType.StoredProcedure; using (SqlDataReader sdr = cmd.ExecuteReader()) { if ((sdr != null) && (sdr.HasRows)) { if (sdr.Read()) { spare = new Spare(); spare.ID = (sdr["ID"].ToString() != "" ? Guid.Parse(sdr["ID"].ToString()) : spare.ID); spare.Code = (sdr["Code"].ToString() != "" ? sdr["Code"].ToString() : spare.Code); spare.Name = (sdr["Name"].ToString() != "" ? sdr["Name"].ToString() : spare.Name); spare.HSNCode = (sdr["HSNCode"].ToString() != "" ? sdr["HSNCode"].ToString() : spare.HSNCode); } } } } } } catch (Exception ex) { throw ex; } return(spare); }
public IEnumerator <SpareType> GetEnumerator() { return(Spare.OfType <SpareType>().GetEnumerator()); }
IEnumerator IEnumerable.GetEnumerator() { return(Spare.OfType <SpareType>().GetEnumerator()); }
public void Give_The_Score_For_SpareFrame() { Frame basicFrame = new Spare(3); Check.That(basicFrame.GetScore(3, 1)).IsEqualTo(13); }
public void Give_The_Sum_Of_Bowling_Pin_Fallen_For_Spare(int firstRoll, int expected) { Frame basicFrame = new Spare(firstRoll); Check.That(basicFrame.GetBowlingPinFallen()).IsEqualTo(expected); }
internal void LoadData(MediaType mediaType, byte[] dds, byte[] cartridgeStatus, byte[] spareArea, byte[] lastBorderOutRmd, byte[] preRecordedInfo, byte[] mediaIdentifier, byte[] physicalInformation, byte[] mediumStatus, byte[] hdLastRmd, byte[] layerCapacity, byte[] middleZoneStart, byte[] jumpIntervalSize, byte[] manualLayerJumpStartLba, byte[] remapAnchorPoint, byte[] adip, byte[] dcb) { dvdRamDds = dds; dvdRamCartridgeStatus = cartridgeStatus; dvdRamSpareArea = spareArea; dvdLastBorderOutRmd = lastBorderOutRmd; dvdPreRecordedInfo = preRecordedInfo; dvdrMediaIdentifier = mediaIdentifier; dvdrPhysicalInformation = physicalInformation; hddvdrMediumStatus = mediumStatus; hddvdrLastRmd = hdLastRmd; dvdrLayerCapacity = layerCapacity; dvdrDlMiddleZoneStart = middleZoneStart; dvdrDlJumpIntervalSize = jumpIntervalSize; dvdrDlManualLayerJumpStartLba = manualLayerJumpStartLba; dvdrDlRemapAnchorPoint = remapAnchorPoint; dvdPlusAdip = adip; dvdPlusDcb = dcb; switch (mediaType) { case MediaType.DVDR: Text = "DVD-R"; break; case MediaType.DVDRW: Text = "DVD-RW"; break; case MediaType.DVDPR: Text = "DVD+R"; break; case MediaType.DVDPRW: Text = "DVD+RW"; break; case MediaType.DVDPRWDL: Text = "DVD+RW DL"; break; case MediaType.DVDRDL: Text = "DVD-R DL"; break; case MediaType.DVDPRDL: Text = "DVD+R DL"; break; case MediaType.DVDRAM: Text = "DVD-RAM"; break; case MediaType.DVDRWDL: Text = "DVD-RW DL"; break; case MediaType.HDDVDRAM: Text = "HD DVD-RAM"; break; case MediaType.HDDVDR: Text = "HD DVD-R"; break; case MediaType.HDDVDRW: Text = "HD DVD-RW"; break; case MediaType.HDDVDRDL: Text = "HD DVD-R DL"; break; case MediaType.HDDVDRWDL: Text = "HD DVD-RW DL"; break; } if (dds != null) { grpDvdRamDds.Visible = true; btnSaveDvdRamDds.Visible = true; txtDvdRamDds.Text = DDS.Prettify(dds); } if (cartridgeStatus != null) { grpDvdRamCartridgeStatus.Visible = true; btnSaveDvdRamCartridgeStatus.Visible = true; txtDvdRamCartridgeStatus.Text = Cartridge.Prettify(cartridgeStatus); } if (spareArea != null) { grpDvdRamSpareAreaInformation.Visible = true; btnSaveDvdRamSpareAreaInformation.Visible = true; txtDvdRamSpareAreaInformation.Text = Spare.Prettify(spareArea); } btnSaveDvdRamDds.Visible = dds != null; btnSaveDvdRamCartridgeStatus.Visible = cartridgeStatus != null; btnSaveDvdRamSpareAreaInformation.Visible = spareArea != null; btnSaveLastBorderOutRmd.Visible = lastBorderOutRmd != null; btnSaveDvdPreRecordedInfo.Visible = preRecordedInfo != null; btnSaveDvdrMediaIdentifier.Visible = mediaIdentifier != null; btnSaveDvdrPhysicalInformation.Visible = physicalInformation != null; btnSaveHddvdrMediumStatus.Visible = mediumStatus != null; btnSaveHddvdrLastRmd.Visible = hdLastRmd != null; btnSaveDvdrLayerCapacity.Visible = layerCapacity != null; btnSaveDvdrDlMiddleZoneStart.Visible = middleZoneStart != null; btnSaveDvdrDlJumpIntervalSize.Visible = jumpIntervalSize != null; btnSaveDvdrDlManualLayerJumpStartLba.Visible = manualLayerJumpStartLba != null; btnSaveDvdrDlRemapAnchorPoint.Visible = remapAnchorPoint != null; btnSaveDvdPlusAdip.Visible = adip != null; btnSaveDvdPlusDcb.Visible = dcb != null; Visible = grpDvdRamDds.Visible || grpDvdRamCartridgeStatus.Visible || grpDvdRamSpareAreaInformation.Visible || btnSaveDvdRamDds.Visible || btnSaveDvdRamCartridgeStatus.Visible || btnSaveDvdRamSpareAreaInformation.Visible || btnSaveLastBorderOutRmd.Visible || btnSaveDvdPreRecordedInfo.Visible || btnSaveDvdrMediaIdentifier.Visible || btnSaveDvdrPhysicalInformation.Visible || btnSaveHddvdrMediumStatus.Visible || btnSaveHddvdrLastRmd.Visible || btnSaveDvdrLayerCapacity.Visible || btnSaveDvdrDlMiddleZoneStart.Visible || btnSaveDvdrDlJumpIntervalSize.Visible || btnSaveDvdrDlManualLayerJumpStartLba.Visible || btnSaveDvdrDlRemapAnchorPoint.Visible || btnSaveDvdPlusAdip.Visible || btnSaveDvdPlusDcb.Visible; }
public bool updateSpare(string id, Spare spare) { // string query = "UPDATE `spares` SET " return(false); }
public BlurayInfoViewModel([CanBeNull] byte[] blurayDiscInformation, [CanBeNull] byte[] blurayBurstCuttingArea, [CanBeNull] byte[] blurayDds, [CanBeNull] byte[] blurayCartridgeStatus, [CanBeNull] byte[] bluraySpareAreaInformation, [CanBeNull] byte[] blurayPowResources, [CanBeNull] byte[] blurayTrackResources, [CanBeNull] byte[] blurayRawDfl, [CanBeNull] byte[] blurayPac, Window view) { _view = view; _discInformation = blurayDiscInformation; _burstCuttingArea = blurayBurstCuttingArea; _dds = blurayDds; _cartridgeStatus = blurayCartridgeStatus; _spareAreaInformation = bluraySpareAreaInformation; _powResources = blurayPowResources; _trackResources = blurayTrackResources; _rawDfl = blurayRawDfl; _pac = blurayPac; SaveBlurayDiscInformationCommand = ReactiveCommand.Create(ExecuteSaveBlurayDiscInformationCommand); SaveBlurayBurstCuttingAreaCommand = ReactiveCommand.Create(ExecuteSaveBlurayBurstCuttingAreaCommand); SaveBlurayDdsCommand = ReactiveCommand.Create(ExecuteSaveBlurayDdsCommand); SaveBlurayCartridgeStatusCommand = ReactiveCommand.Create(ExecuteSaveBlurayCartridgeStatusCommand); SaveBluraySpareAreaInformationCommand = ReactiveCommand.Create(ExecuteSaveBluraySpareAreaInformationCommand); SaveBlurayPowResourcesCommand = ReactiveCommand.Create(ExecuteSaveBlurayPowResourcesCommand); SaveBlurayTrackResourcesCommand = ReactiveCommand.Create(ExecuteSaveBlurayTrackResourcesCommand); SaveBlurayRawDflCommand = ReactiveCommand.Create(ExecuteSaveBlurayRawDflCommand); SaveBlurayPacCommand = ReactiveCommand.Create(ExecuteSaveBlurayPacCommand); if (blurayDiscInformation != null) { SaveBlurayDiscInformationVisible = true; BlurayDiscInformationText = DI.Prettify(blurayDiscInformation); } if (blurayBurstCuttingArea != null) { SaveBlurayBurstCuttingAreaVisible = true; BlurayBurstCuttingAreaText = BCA.Prettify(blurayBurstCuttingArea); } if (blurayDds != null) { SaveBlurayDdsVisible = true; BlurayDdsText = DDS.Prettify(blurayDds); } if (blurayCartridgeStatus != null) { SaveBlurayCartridgeStatusVisible = true; BlurayCartridgeStatusText = Cartridge.Prettify(blurayCartridgeStatus); } if (bluraySpareAreaInformation != null) { SaveBluraySpareAreaInformationVisible = true; BluraySpareAreaInformationText = Spare.Prettify(bluraySpareAreaInformation); } if (blurayPowResources != null) { SaveBlurayPowResourcesVisible = true; BlurayPowResourcesText = DiscInformation.Prettify(blurayPowResources); } if (blurayTrackResources != null) { SaveBlurayTrackResourcesVisible = true; BlurayTrackResourcesText = DiscInformation.Prettify(blurayTrackResources); } SaveBlurayRawDflVisible = blurayRawDfl != null; SaveBlurayPacVisible = blurayPac != null; }
public static IList<IFrame> GetAllFramesAsSpares() { var frames = new List<IFrame>(); IFrame previousFrame = null; for (var i = 0; i < 10; i++) { var frame = new Spare(5, i + 1, previousFrame); frames.Add(frame); previousFrame = frame; } frames.Add(new BonusFrame(5, 0, 11, previousFrame)); return frames; }