public OwnerViewModel(OWNERS owner) { this.FNAME = owner.FNAME; this.LNAME = owner.LNAME; this.PHONE = owner.PHONE; this.OWNERID = owner.OWNERID; }
public void Test_SUD_RC_Owners() { RC_Owners ow = new RC_Owners(); OWNERS ow1 = new OWNERS() { id_owner = 0, name = "Тест", abr = "ТСТ", id_country = null, id_ora = null, id_ora_temp = null, }; int res_ow1 = ow.SaveOwners(ow1); Test_RC_Owners(res_ow1); OWNERS ow2 = new OWNERS() { id_owner = res_ow1, name = "Тест1111", abr = "ТСТ111", id_country = null, id_ora = null, id_ora_temp = null, }; int res_ow2 = ow.SaveOwners(ow2); Test_RC_Owners(res_ow2); OWNERS ow_del = ow.DeleteOwners(res_ow2); WL(ow_del); }
public void SetDroneOwner(DroneBase drone, OWNERS owner) { Color droneColor = Color.yellow; switch (owner) { case OWNERS.PLAYER: droneColor = Color.green; break; case OWNERS.RAIDER: droneColor = Color.red; break; case OWNERS.NEUTRAL: droneColor = Color.white; break; } foreach (Image image in images) { image.color = droneColor; } idText.color = droneColor; UserDrone uDrone = drone.GetComponent <UserDrone>(); if (uDrone != null) { idText.text = uDrone.GetStringIdentifier(); } }
public void Update() { OWNERS dbOwner = DbContext.OWNERS.Find(SelectedOwner.OWNERID); dbOwner.FNAME = SelectedOwner.FNAME; dbOwner.LNAME = SelectedOwner.LNAME; dbOwner.PHONE = SelectedOwner.PHONE; DbContext.SaveChanges(); }
/// <summary> /// Получить Id владельца по id системы КИС /// </summary> /// <param name="id_sob_kis"></param> /// <returns></returns> public int?GetIDOwnersOfKis(int id_sob_kis) { OWNERS ow = GetOwnersOfKis(id_sob_kis); if (ow != null) { return(ow.id_owner); } return(null); }
/// <summary> /// Удалить /// </summary> /// <param name="id_way"></param> /// <returns></returns> public OWNERS DeleteOWNERS(int id_owner) { OWNERS dbEntry = context_edit.OWNERS.Find(id_owner); if (dbEntry != null) { context_edit.OWNERS.Remove(dbEntry); context_edit.SaveChanges(); } return(dbEntry); }
public void Add() { OWNERS dbOwner = new OWNERS(); dbOwner.FNAME = SelectedOwner.FNAME; dbOwner.LNAME = SelectedOwner.LNAME; dbOwner.PHONE = SelectedOwner.PHONE; SelectedOwner.FNAME = ""; SelectedOwner.LNAME = ""; SelectedOwner.PHONE = ""; SelectedOwner.OWNERID = 0; DbContext.OWNERS.Add(dbOwner); DbContext.SaveChanges(); OwnersList.Add(new OwnerViewModel(dbOwner)); }
public void Test_References_Owner() { TransferWagons.Railcars.ReferencesKIS refer = new TransferWagons.Railcars.ReferencesKIS(); //refer.DefinitionIDOwner(53,null); Console.WriteLine("Новая перевозочная компания 123 = {0}", refer.DefinitionIDOwner(53, null)); Console.WriteLine("Null = {0}", refer.DefinitionIDOwner(0, null)); int?new_ow = refer.DefinitionIDOwner(-1, null); Console.WriteLine("Новый (-1) = {0}", new_ow); if (new_ow != null) { RC_Owners ow = new RC_Owners(); OWNERS ow_del = ow.DeleteOwners((int)new_ow); } }
/// <summary> /// Добавить или править /// </summary> /// <param name="WAYS"></param> /// <returns></returns> public int SaveOWNERS(OWNERS OWNERS) { OWNERS dbEntry; if (OWNERS.id_owner == 0) { dbEntry = new OWNERS() { id_owner = OWNERS.id_owner, name = OWNERS.name, abr = OWNERS.abr, id_country = OWNERS.id_country, id_ora = OWNERS.id_ora, id_ora_temp = OWNERS.id_ora_temp, }; context_edit.OWNERS.Add(dbEntry); } else { dbEntry = context_edit.OWNERS.Find(OWNERS.id_owner); if (dbEntry != null) { dbEntry.id_owner = OWNERS.id_owner; dbEntry.name = OWNERS.name; dbEntry.abr = OWNERS.abr; dbEntry.id_country = OWNERS.id_country; dbEntry.id_ora = OWNERS.id_ora; dbEntry.id_ora_temp = OWNERS.id_ora_temp; } } try { context_edit.SaveChanges(); } catch (Exception e) { return(-1); } return(dbEntry.id_owner); }
public void SetOwner(OWNERS newOwner) { owner = newOwner; }
/// <summary> /// Добавить удалить /// </summary> /// <param name="vagons"></param> /// <returns></returns> public int SaveOwners(OWNERS owners) { return(rep_ow.SaveOWNERS(owners)); }
public void WL(OWNERS t) { Console.WriteLine("id_owner: {0}, name: {1}, abr: {2}, id_country: {3}, id_ora: {4}, id_ora_temp: {5}", t.id_owner, t.name, t.abr, t.id_country, t.id_ora, t.id_ora_temp); }