public HooktheoryLoginDialog(GetAPI api) { InitializeComponent(); _api = api; DataContext = _viewModel = new HooktheoryLoginViewModel(_api); }
internal Workspace(Type backendType, object[] targets, GetAPI getAPI, Action Repaint, Action <Action> Exec) { this.Repaint = Repaint; this.Exec = Exec; this.api = getAPI(1) as RelationsInspectorAPI; graphBackend = (IGraphBackendInternal <T, P>)BackendTypeUtil.CreateBackendDecorator(backendType); graphBackend.Awake(getAPI); // create new layout params, they are not comming from the cfg yet this.layoutType = (LayoutType)GUIUtil.GetPrefsInt(GetPrefsKeyLayout(), (int)LayoutType.Tree); this.graphPosTweens = new TweenCollection(); this.builderRNG = new RNG(4); // chosen by fair dice role. guaranteed to be random. expectedTargetType = BackendTypeUtil.BackendAttrType(backendType) ?? typeof(T); // when targets is null, show the toolbar only. don't create a graph (and view) // when rootEntities is empty, create graph and view anyway, so the user can add entities if (targets != null) { seedEntities = targets.SelectMany(graphBackend.Init).ToHashSet(); InitGraph(); } }
public async Task <IActionResult> IndexAsync() { List <Users> MyUsers = new List <Users>(); List <Rolet> MyRolets = new List <Rolet>(); using (var httpClient = new HttpClient()) { MyUsers = await GetAPI.GetUserListAsync(httpClient); MyRolets = await GetAPI.GetRoletListAsync(httpClient); ViewBag.JsonUser = await GetJsonXml.GetJsonUser(httpClient); ViewBag.XmlUser = await GetJsonXml.GetXmlUser(httpClient); ViewBag.JsonRolet = await GetJsonXml.GetJsonRolet(httpClient); ViewBag.XmlRolet = await GetJsonXml.GetXmlRolet(httpClient); } foreach (var user in MyUsers) { foreach (var role in MyRolets) { if (user.RoleId == role.RoletId) { user.Role = role; } } } return(View(MyUsers)); }
public async Task <IActionResult> DeleteDetails(int?id) { if (id == null) { ModelState.AddModelError(string.Empty, "There was an error while getting student!"); } Studenti studenti = new Studenti(); using (var httpClient = new HttpClient()) { studenti = await GetAPI.GetStudentiAsync(httpClient, id); Drejtimet drejtimet = await GetAPI.GetDrejtimiAsync(httpClient, studenti.DrejtimiId); List <Statuset> MyStatusets = await GetAPI.GetStatusiListAsync(httpClient); studenti.Drejtimi = drejtimet; foreach (var status in MyStatusets) { if (studenti.StatusiId == status.StatusiId) { studenti.Statusi = status; } } } if (studenti == null) { ModelState.AddModelError(string.Empty, "There was an error while getting student!"); } return(View(studenti)); }
public async Task <IActionResult> Details(int?id) { if (id == null) { ModelState.AddModelError(string.Empty, "There was an error while getting user!"); } Users user = new Users(); using (var httpClient = new HttpClient()) { user = await GetAPI.GetUserAsync(httpClient, id); Rolet rolet = await GetAPI.GetRoletAsync(httpClient, id); user.Role = rolet; } if (user == null) { ModelState.AddModelError(string.Empty, "There was an error while getting user!"); } return(View(user)); }
public async Task <IActionResult> Index() { List <Lendet> MyLendets = new List <Lendet>(); List <Drejtimet> MyDrejtimets = new List <Drejtimet>(); using (var httpClient = new HttpClient()) { MyLendets = await GetAPI.GetLendetListAsync(httpClient); MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient); ViewBag.JsonDrejtimet = await GetJsonXml.GetJsonDrejtimet(httpClient); ViewBag.XmlDrejtimet = await GetJsonXml.GetXmlDrejtimet(httpClient); ViewBag.JsonLendet = await GetJsonXml.GetJsonLendet(httpClient); ViewBag.XmlLendet = await GetJsonXml.GetXmlLendet(httpClient); } foreach (var lende in MyLendets) { foreach (var drejtim in MyDrejtimets) { if (lende.DrejtimiId == drejtim.DrejtimetId) { lende.Drejtimi = drejtim; } } } return(View(MyLendets)); }
public async Task <IActionResult> Details(int?id) { if (id == null) { ModelState.AddModelError(string.Empty, "There was an error while getting student!"); } Provimet provimi = new Provimet(); using (var httpClient = new HttpClient()) { provimi = await GetAPI.GetProvimetAsync(httpClient, id); Lendet lendet = await GetAPI.GetLendetAsync(httpClient, provimi.LendaId); Studenti studenti = await GetAPI.GetStudentiAsync(httpClient, provimi.StudentiId); Profesoret profesoret = await GetAPI.GetProfesoretAsync(httpClient, provimi.ProfesoriId); provimi.Lenda = lendet; provimi.Studenti = studenti; provimi.Profesori = profesoret; } if (provimi == null) { ModelState.AddModelError(string.Empty, "There was an error while getting student!"); } return(View(provimi)); }
public async Task <IActionResult> Index() { List <Profesoret> MyProfesorets = new List <Profesoret>(); List <Lendet> MyLendets = new List <Lendet>(); using (var httpClient = new HttpClient()) { MyProfesorets = await GetAPI.GetProfesoretListAsync(httpClient); MyLendets = await GetAPI.GetLendetListAsync(httpClient); ViewBag.JsonProfesoret = await GetJsonXml.GetJsonProfesoret(httpClient); ViewBag.XmlProfesoret = await GetJsonXml.GetXmlProfesoret(httpClient); ViewBag.JsonLendet = await GetJsonXml.GetJsonLendet(httpClient); ViewBag.XmlLendet = await GetJsonXml.GetXmlLendet(httpClient); } foreach (var profesor in MyProfesorets) { foreach (var lende in MyLendets) { if (profesor.LendaId == lende.LendetId) { profesor.Lenda = lende; } } } return(View(MyProfesorets)); }
public async Task <IActionResult> Details(int?id) { if (id == null) { ModelState.AddModelError(string.Empty, "There was an error while getting student!"); } Lendet lendet = new Lendet(); using (var httpClient = new HttpClient()) { lendet = await GetAPI.GetLendetAsync(httpClient, id); Drejtimet drejtimet = await GetAPI.GetDrejtimiAsync(httpClient, lendet.DrejtimiId); lendet.Drejtimi = drejtimet; } if (lendet == null) { ModelState.AddModelError(string.Empty, "There was an error while getting student!"); } return(View(lendet)); }
public void Awake(GetAPI getAPI) { api = getAPI(1) as RelationsInspectorAPI; sceneObj = new GameObject(); sceneObj.name = "Scene"; sceneObj.hideFlags = HideFlags.HideAndDontSave; }
public async Task <IActionResult> Edit(Lendet lendet) { using (var httpClient = new HttpClient()) { if (ModelState.IsValid) { using var response = await httpClient.PutAsJsonAsync <Lendet>(getApi + "/" + lendet.LendetId, lendet); if (response.IsSuccessStatusCode) { ViewBag.Result = "Success"; return(RedirectToAction(nameof(Index))); } } else { ModelState.AddModelError(string.Empty, "Plotesoni te gjitha format!"); } List <Drejtimet> MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient); ViewData["DrejtimiId"] = new SelectList(MyDrejtimets, "DrejtimetId", "EmriDrejtimit", lendet.DrejtimiId); } return(View()); }
public async Task <IActionResult> Edit(Users user) { using (var httpClient = new HttpClient()) { if (ModelState.IsValid) { using var response = await httpClient.PutAsJsonAsync <Users>(getApi + "/" + user.UsersId, user); if (response.IsSuccessStatusCode) { ViewBag.Result = "Success"; return(RedirectToAction(nameof(Index))); } } else { ModelState.AddModelError(string.Empty, "Plotesoni te gjitha fushat!"); } List <Rolet> MyRolets = await GetAPI.GetRoletListAsync(httpClient); ViewData["RoleId"] = new SelectList(MyRolets, "RoletId", "RoleName", user.RoleId); } return(View()); }
public async Task <IActionResult> CreateAsync() { using var httpClient = new HttpClient(); List <Rolet> MyRolets = await GetAPI.GetRoletListAsync(httpClient); ViewData["RoleId"] = new SelectList(MyRolets, "RoletId", "RoleName"); return(View()); }
public async Task <IActionResult> CreateAsync() { using var httpClient = new HttpClient(); List <Drejtimet> MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient); ViewData["DrejtimiId"] = new SelectList(MyDrejtimets, "DrejtimetId", "EmriDrejtimit"); return(View()); }
public async Task <IActionResult> CreateAsync() { using var httpClient = new HttpClient(); List <Lendet> MyLendets = await GetAPI.GetLendetListAsync(httpClient); ViewData["LendaId"] = new SelectList(MyLendets, "LendetId", "EmriLendes"); return(View()); }
public override void Awake(GetAPI getAPI) { relatingFields = ReflectionUtil.GetAttributeFields <T, RelatingAttribute>(); relatedFields = ReflectionUtil.GetAttributeFields <T, RelatedAttribute>(); if (!relatingFields.Any() && !relatedFields.Any()) { Debug.LogError("Type has auto backend attribute, but no fields marked as related or relating: " + typeof(T)); } base.Awake(getAPI); }
public void Awake(GetAPI getAPI) { try { backend.Awake(getAPI); } catch (Exception e) { Debug.LogException(e); } }
public async Task <IActionResult> EditForm(int id) { Drejtimet drejtimet = new Drejtimet(); using (var httpClient = new HttpClient()) { drejtimet = await GetAPI.GetDrejtimiAsync(httpClient, id); } return(View(drejtimet)); }
public async Task <IActionResult> EditForm(int id) { Rolet rolet = new Rolet(); using (var httpClient = new HttpClient()) { rolet = await GetAPI.GetRoletAsync(httpClient, id); } return(View(rolet)); }
static void Main(string[] args) { for (int i = 1; i < 50; i++) { Console.SetWindowSize(3 * i, i); System.Threading.Thread.Sleep(200); } string Progresbar = "This is a currency converter"; var title = ""; while (true) { for (int i = 0; i < Progresbar.Length; i++) { title += Progresbar[i]; Console.Title = title; Thread.Sleep(100); } title = ""; Console.Clear(); //GetDataAccess dataaccess = new GetDataAccess(); GetAPI api = DownloadPageAsync().Result; //dataaccess.InsertIntoSQL(api); Console.ForegroundColor = ConsoleColor.DarkCyan; Console.WriteLine("Välkommen till Valutaappen, glöm inte papper och penna"); Console.ResetColor(); Console.WriteLine(); Console.WriteLine("A) Se alla valutor i världen med EURO som bas"); Console.WriteLine("B) Konvertera en valfri valuta"); Console.WriteLine("C) Avsluta appen"); var command = Console.ReadKey().Key; if (command == ConsoleKey.C) { CloseApp(); break; } switch (command) { case ConsoleKey.A: ShowAllRates(); break; case ConsoleKey.B: ConvertRates(); break; } Console.ReadKey(); Console.Clear(); } }
public void Login() { T_SystemUser user = new T_SystemUser(); using (UserDetail _userdetails = new UserDetail()) { if (!string.IsNullOrWhiteSpace(txtUsername.Text) && !string.IsNullOrWhiteSpace(txtPassword.Text)) { user.Username = txtUsername.Text; user.EncryptedPassword = EncryptedPassword; if (_userdetails.Login(user, ref ReturnMsg)) { pnlLogin.Hide(); SystemProperties.ShowMessage.MessageInformation(ReturnMsg, "Login"); GetAccessRight(true); tsOffline.Text = "Online"; tsOffline.ForeColor = Color.Green; tsUser.Text = !string.IsNullOrWhiteSpace(UserInfo.DisplayName)?UserInfo.DisplayName:UserInfo.CompleteName; tsTimeIN.Text = UserInfo.TimeIn.ToString("MMM. dd, yyyy | HH:mm:ss tt"); tsPosition.Text = UserInfo.JobTitle; mtLogin.Enabled = !(mtLogout.Enabled = true); using (GetAPI getapi = new GetAPI()) { getapi.CheckInternetConnection(); } GetActiveSemester(); } else { foreach (Form frm in this.MdiChildren) { if (!frm.Focused) { frm.Close(); } } tsOffline.ForeColor = Color.Red; tsOffline.Text = "Offline"; tsUser.Text = ""; tsTimeIN.Text = ""; tsPosition.Text = ""; pnlLogin.Show(); GetAccessRight(false); mtLogin.Enabled = !(mtLogout.Enabled = false); SystemProperties.ShowMessage.MessageError(ReturnMsg, "Login"); } } else { SystemProperties.ShowMessage.MessageError(string.Format("Please check your input below " + Environment.NewLine + Environment.NewLine + "Username" + Environment.NewLine + "Password"), SystemSetup.SystemName); } } }
public JsonResult skills(string skilltype) { string data = GetAPI.GetSkillTypeData(skilltype); String[] skillsList = null; if (data != "Not Found") { skillsList = data.Split(new String[] { "," }, StringSplitOptions.None); return(Json(skillsList, JsonRequestBehavior.AllowGet)); } return(Json(false, JsonRequestBehavior.AllowGet)); }
void Start() { Debug.Log("Start"); StartCoroutine( GetAPI.GetRequest( "http://jsonplaceholder.typicode.com/posts", (JSONNode JSONresponse) => { HandleAPIresponse(JSONresponse); } ) ); }
public override void Awake(GetAPI getAPI) { base.Awake(getAPI); var targets = api.GetTargets(); if (targets.Length == 1 && (targets[0] as string == "currentScene")) { ResetGraph(); } busFilter = EditorPrefs.GetString(busFilterPrefsKey, string.Empty); groupFilter = EditorPrefs.GetString(groupFilterPrefsKey, string.Empty); }
public async Task <IActionResult> Index() { List <Rolet> MyRolets = new List <Rolet>(); using (var httpClient = new HttpClient()) { MyRolets = await GetAPI.GetRoletListAsync(httpClient); ViewBag.JsonRolet = await GetJsonXml.GetJsonRolet(httpClient); ViewBag.XmlRolet = await GetJsonXml.GetXmlRolet(httpClient); } return(View(MyRolets)); }
public async Task <IActionResult> EditForm(int id) { Profesoret profesoret = new Profesoret(); using (var httpClient = new HttpClient()) { profesoret = await GetAPI.GetProfesoretAsync(httpClient, id); List <Lendet> MyLendets = await GetAPI.GetLendetListAsync(httpClient); ViewData["LendaId"] = new SelectList(MyLendets, "LendetId", "EmriLendes"); } return(View(profesoret)); }
public async Task <IActionResult> EditForm(int id) { Users user = new Users(); using (var httpClient = new HttpClient()) { user = await GetAPI.GetUserAsync(httpClient, id); List <Rolet> MyRolets = await GetAPI.GetRoletListAsync(httpClient); ViewData["RoleId"] = new SelectList(MyRolets, "RoletId", "RoleName"); } return(View(user)); }
public async Task <IActionResult> EditForm(int id) { Lendet lendet = new Lendet(); using (var httpClient = new HttpClient()) { lendet = await GetAPI.GetLendetAsync(httpClient, id); List <Drejtimet> MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient); ViewData["DrejtimiId"] = new SelectList(MyDrejtimets, "DrejtimetId", "EmriDrejtimit"); } return(View(lendet)); }
public async Task <IActionResult> Index() { List <Drejtimet> MyDrejtimets = new List <Drejtimet>(); using (var httpClient = new HttpClient()) { MyDrejtimets = await GetAPI.GetDrejtimiListAsync(httpClient); ViewBag.Json = await GetJsonXml.GetJsonDrejtimet(httpClient); ViewBag.Xml = await GetJsonXml.GetXmlDrejtimet(httpClient); } return(View(MyDrejtimets)); }
public async Task <IActionResult> CreateAsync() { using var httpClient = new HttpClient(); List <Lendet> MyLendets = await GetAPI.GetLendetListAsync(httpClient); List <Studenti> MyStudentis = await GetAPI.GetStudentiListAsync(httpClient); List <Profesoret> MyProfesorets = await GetAPI.GetProfesoretListAsync(httpClient); ViewData["LendaId"] = new SelectList(MyLendets, "LendetId", "EmriLendes"); ViewData["StudentiId"] = new SelectList(MyStudentis, "StudentId", "FullName"); ViewData["ProfesoriId"] = new SelectList(MyProfesorets, "ProfesoretId", "EmriProfesorit"); return(View()); }