public List <TechnicalLog> GetTechEvents(string techId = "") { Datahandler dh = Datahandler.getData(); List <TechnicalLog> events = new List <TechnicalLog>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetTechEvents); foreach (DataRow item in table.Rows) { TechnicalLog tl = new TechnicalLog(); tl.ReqEvent = new RequestedEvents(); tl.ReqEvent.EventId = Convert.ToInt32(item[DataAccesHelper.tlEventId].ToString()); tl.TlTech = new Technicians(); tl.TlTech.PersonId = item[DataAccesHelper.tlEventTechId].ToString(); events.Add(tl); } return(events); }
public List <PaymentDetails> GetAllPaymentDetails() { Datahandler dh = Datahandler.getData(); List <PaymentDetails> details = new List <PaymentDetails>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetPaymentDetails); foreach (DataRow item in table.Rows) { PaymentDetails pd = new PaymentDetails(); pd.AccNr = item[DataAccesHelper.paymentDetAccNr].ToString(); pd.Bank = item[DataAccesHelper.paymentDetBank].ToString(); pd.BranchCode = item[DataAccesHelper.paymentDetBranch].ToString(); pd.PaymentDet_Client = new Client(); pd.PaymentDet_Client.ClientIdentifier = item[DataAccesHelper.paymentDetClientId].ToString(); details.Add(pd); } return(details); }
public List <TechnicalDetails> GetComponentTechDet() { Datahandler dh = Datahandler.getData(); List <TechnicalDetails> techDets = new List <TechnicalDetails>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetTechnicalDetails + this.TechDet_Config.ConfigId + "'"); foreach (DataRow item in table.Rows) { TechnicalDetails td = new TechnicalDetails(); td.DetailId = Convert.ToInt32(item[DataAccesHelper.tecDetId].ToString()); td.DocPath = item[DataAccesHelper.tecDetDocPath].ToString(); td.TechDet_Config = new Configurations(); td.TechDet_Config.ConfigId = item[DataAccesHelper.tecDetConfCode].ToString(); techDets.Add(td); } return(techDets); }
public List <ComponentVendors> GetComponentVendors() { Datahandler dh = Datahandler.getData(); List <ComponentVendors> compVends = new List <ComponentVendors>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetComponentVendors + this.CvComponents.CompCode + "'"); foreach (DataRow item in table.Rows) { ComponentVendors cv = new ComponentVendors(); cv.CvComponents = new SystemComponents(); cv.CvComponents.CompCode = item[DataAccesHelper.cvCompCode].ToString(); cv.CvVendor = new Vendor(); cv.CvVendor.VendorCode = item[DataAccesHelper.cvVendorCode].ToString(); compVends.Add(cv); } return(compVends); }
public List <Billing> GetClientBilling() { Datahandler dh = Datahandler.getData(); List <Billing> bill = new List <Billing>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetBilling + this.Billing_Client.ClientIdentifier + "'"); foreach (DataRow item in table.Rows) { Billing b = new Billing(); b.Billing_Client = new Client(); b.Billing_Client.ClientIdentifier = item[DataAccesHelper.billingClientid].ToString(); b.AmountDue = Convert.ToDouble(item[DataAccesHelper.billAmountDue].ToString()); b.AmountPaid = Convert.ToDouble(item[DataAccesHelper.billAmountPaid].ToString()); b.Date = Convert.ToDateTime(item[DataAccesHelper.billingDate].ToString()); bill.Add(b); } return(bill); }
public List <ContractProducts> GetContractProducts() { Datahandler dh = Datahandler.getData(); List <ContractProducts> clientProds = new List <ContractProducts>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetContractProducts + this.ContractProducts_Contract.ContractIdentifier + "'"); foreach (DataRow item in table.Rows) { ContractProducts cp = new ContractProducts(); cp.ContractProducts_Contract = new Contract(); cp.ContractProducts_Contract.ContractIdentifier = item[DataAccesHelper.cpContractId].ToString(); List <Product> p = new Product().GetAllProducts(item[DataAccesHelper.cpProductCode].ToString()); cp.ContractProducts_Product = p[0]; clientProds.Add(cp); } return(clientProds); }
public bool UpdateTech() { Datahandler dh = Datahandler.getData(); Dictionary <string, string[]> tech_details = new Dictionary <string, string[]>(); tech_details.Add(QueryBuilder.spUpdateTech.sp_id, new string[] { DataAccesHelper.typeString, this.PersonId }); tech_details.Add(QueryBuilder.spUpdateTech.sp_name, new string[] { DataAccesHelper.typeString, this.Name }); tech_details.Add(QueryBuilder.spUpdateTech.sp_surname, new string[] { DataAccesHelper.typeString, this.Surname }); tech_details.Add(QueryBuilder.spUpdateTech.sp_status, new string[] { DataAccesHelper.typeString, this.Status }); tech_details.Add(QueryBuilder.spUpdateTech.sp_skill, new string[] { DataAccesHelper.typeString, this.SkillLevel }); tech_details.Add(QueryBuilder.spUpdateTech.sp_addrLine1, new string[] { DataAccesHelper.typeString, this.PersonAddress.AddressLine1 }); tech_details.Add(QueryBuilder.spUpdateTech.sp_addrLine2, new string[] { DataAccesHelper.typeString, this.PersonAddress.AddressLine2 }); tech_details.Add(QueryBuilder.spUpdateTech.sp_city, new string[] { DataAccesHelper.typeString, this.PersonAddress.City }); tech_details.Add(QueryBuilder.spUpdateTech.sp_postCode, new string[] { DataAccesHelper.typeString, this.PersonAddress.PostalCode }); tech_details.Add(QueryBuilder.spUpdateTech.sp_cell, new string[] { DataAccesHelper.typeString, this.PersonContact.Cell }); tech_details.Add(QueryBuilder.spUpdateTech.sp_email, new string[] { DataAccesHelper.typeString, this.PersonContact.Email }); return(dh.runStoredProcedure(QueryBuilder.spUpdateTech.sp, tech_details)); }
public bool NewClient() { Datahandler dh = Datahandler.getData(); Dictionary <string, string[]> client_details = new Dictionary <string, string[]>(); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_id, new string[] { DataAccesHelper.typeString, this.PersonId }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_name, new string[] { DataAccesHelper.typeString, this.Name }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_surname, new string[] { DataAccesHelper.typeString, this.Surname }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_payMethod, new string[] { DataAccesHelper.typeString, this.PaymentMethod }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_status, new string[] { DataAccesHelper.typeString, this.Status }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_addrLine1, new string[] { DataAccesHelper.typeString, this.PersonAddress.AddressLine1 }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_addrLine2, new string[] { DataAccesHelper.typeString, this.PersonAddress.AddressLine2 }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_city, new string[] { DataAccesHelper.typeString, this.PersonAddress.City }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_postCode, new string[] { DataAccesHelper.typeString, this.PersonAddress.PostalCode }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_cell, new string[] { DataAccesHelper.typeString, this.PersonContact.Cell }); client_details.Add(QueryBuilder.spAddClientWithoutPaymentDetails.sp_email, new string[] { DataAccesHelper.typeString, this.PersonContact.Email }); return(dh.runStoredProcedure(QueryBuilder.spAddClientWithoutPaymentDetails.sp, client_details)); }
public List <Technical_Team> PopulateTechnical_Team() { List <Technical_Team> Technical_TeamList = new List <Technical_Team>(); Datahandler dh = new Datahandler(); DataSet ds = dh.ReadData("TechnicalTeam"); foreach (DataRow item in ds.Tables["TechnicalTeam"].Rows) { Technical_TeamList.Add( new Technical_Team(int.Parse(item["Team ID"].ToString()), int.Parse(item["Job ID"].ToString()), int.Parse(item["Employee ID"].ToString()), int.Parse(item["Employee ID 2"].ToString()), int.Parse(item["Employee ID 3"].ToString()), int.Parse(item["Employee ID 4"].ToString()))); } return(Technical_TeamList); }
public List <Job> PopulateJob() { List <Job> JobList = new List <Job>(); Datahandler dh = new Datahandler(); DataSet ds = dh.ReadData("Job"); foreach (DataRow item in ds.Tables["Job"].Rows) { JobList.Add( new Job(int.Parse(item["Job ID"].ToString()), item["Type"].ToString(), item["Status"].ToString(), item["Start Date"].ToString(), item["End Date"].ToString(), int.Parse(item["Product ID"].ToString()), int.Parse(item["Location ID"].ToString()))); } return(JobList); }
public bool RemoveEvent() { Datahandler dh = Datahandler.getData(); Dictionary <string, string[]> event_details = new Dictionary <string, string[]>(); event_details.Add(DataAccesHelper.eventId, new string[] { DataAccesHelper.typeInt, this.EventId.ToString() }); event_details.Add(DataAccesHelper.eventClientId, new string[] { DataAccesHelper.typeString, this.TechLog_Client.ClientIdentifier }); event_details.Add(DataAccesHelper.eventReqDate, new string[] { DataAccesHelper.typeDateTime, this.RequestedDate.ToShortDateString() }); if (this.CompletedDate.Year >= 2018) { event_details.Add(DataAccesHelper.eventCompDate, new string[] { DataAccesHelper.typeDateTime, this.CompletedDate.ToShortDateString() }); } event_details.Add(DataAccesHelper.eventRemarks, new string[] { DataAccesHelper.typeString, this.Remarks }); event_details.Add(DataAccesHelper.eventStatus, new string[] { DataAccesHelper.typeString, this.Status }); event_details.Add(DataAccesHelper.skillReq, new string[] { DataAccesHelper.typeString, this.SkillRequired }); event_details.Add(DataAccesHelper.eventScheduleOrder, new string[] { DataAccesHelper.typeDateTime, this.ScheduleOrder.ToString() }); return(dh.runQuery(DataAccesHelper.targetRequestedEvents, DataAccesHelper.requestDelete, event_details, DataAccesHelper.eventId + " = " + this.EventId)); }
public List <Employee> PopulateEmployee() { List <Employee> EmployeeList = new List <Employee>(); Datahandler dh = new Datahandler(); DataSet ds = dh.ReadData("Employee"); foreach (DataRow item in ds.Tables["Employee"].Rows) { EmployeeList.Add( new Employee(int.Parse(item["Employee ID"].ToString()), item["Employee Name"].ToString(), item["Employee Surname"].ToString(), int.Parse(item["Department ID"].ToString()), item["Employee Job Description"].ToString(), item["Employee Username"].ToString(), item["Employee Password"].ToString(), item["Employee Status"].ToString())); } return(EmployeeList); }
public List <SystemComponents> GetSystemComponents() { Datahandler dh = Datahandler.getData(); List <SystemComponents> sysComps = new List <SystemComponents>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetSystemComponents + this.SysComps_Product.ProductCode + "'"); foreach (DataRow item in table.Rows) { SystemComponents sc = new SystemComponents(); sc.CompCode = item[DataAccesHelper.compCode].ToString(); sc.Description = item[DataAccesHelper.compDesc].ToString(); sc.SysComps_Product = new Product(); sc.SysComps_Product.ProductCode = item[DataAccesHelper.compProdCode].ToString(); sc.Status = item[DataAccesHelper.compStatus].ToString(); sc.Manufacturer = item[DataAccesHelper.compManufacturer].ToString(); sc.Model = item[DataAccesHelper.compModel].ToString(); sysComps.Add(sc); } return(sysComps); }
public List <Configurations> GetAllConfigurations() { Datahandler dh = Datahandler.getData(); List <Configurations> confs = new List <Configurations>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetConfigurations + this.Configuration_Component.CompCode + "'"); foreach (DataRow item in table.Rows) { Configurations c = new Configurations(); c.ConfigId = item[DataAccesHelper.confCode].ToString(); c.Name = item[DataAccesHelper.confName].ToString(); c.Description = item[DataAccesHelper.confDesc].ToString(); c.AddCost = Convert.ToDouble(item[DataAccesHelper.confAddCost].ToString()); c.Configuration_Component = new SystemComponents(); c.Configuration_Component.CompCode = item[DataAccesHelper.confCompCode].ToString(); c.Status = item[DataAccesHelper.confStatus].ToString(); confs.Add(c); } return(confs); }
public List <RequestedEvents> GetRequestedEvents() { Datahandler dh = Datahandler.getData(); List <RequestedEvents> events = new List <RequestedEvents>(); DataTable table = dh.readDataFromDB(DataAccesHelper.QueryGetRequestedEvents); foreach (DataRow item in table.Rows) { RequestedEvents tl = new RequestedEvents(); tl.EventId = Convert.ToInt32(item[DataAccesHelper.eventId].ToString()); tl.TechLog_Client = new Client(item[DataAccesHelper.clientId].ToString(), item[DataAccesHelper.clientName].ToString(), item[DataAccesHelper.clientSurname].ToString(), new Address(), new Contact(), "", "", item[DataAccesHelper.clientIdentifier].ToString()); tl.RequestedDate = Convert.ToDateTime(item[DataAccesHelper.eventReqDate].ToString()); try { tl.CompletedDate = Convert.ToDateTime(item[DataAccesHelper.eventCompDate].ToString()); } catch { } tl.Remarks = item[DataAccesHelper.eventRemarks].ToString(); tl.SkillRequired = item[DataAccesHelper.skillReq].ToString(); tl.Status = item[DataAccesHelper.eventStatus].ToString(); tl.ScheduleOrder = Convert.ToInt32(item[DataAccesHelper.eventScheduleOrder].ToString()); events.Add(tl); } return(events); }
public async Task LoadData() { SpreekwoordInstance = await SpreekwoordenWrapper.GetInstance(); this.DataContext = SpreekwoordInstance; LoadingControl.SetLoadingStatus(false); LoadingControl.DisplayLoadingError(false); LoadingControl.SetLoadingStatus(true); await SpreekwoordInstance.GetRandomWoorden(); LoadingControl.SetLoadingStatus(false); if (SpreekwoordInstance.ChangeLockscreen) { NotificationHandler.Run("SpreekwoordenBackgroundTaskW.BackgroundTask", "ImageService", (uint)SpreekwoordInstance.IntervalArray[SpreekwoordInstance.SelectedInterval]); } int ID = await Task.Run(() => Datahandler.GetRandomSpreekwoordAndSaveImageToFile()); await LockScreen.SetImageFileAsync(await ApplicationData.Current.LocalFolder.GetFileAsync("Tegeltje" + ID + ".jpg")); }
private void DoMyWindow(int windowID) { switch (pgState) { case programStates.StartWindow: if (completeT) { drawTw = false; locationT = tfsw.getLocation; completeT = false; } if (completeC) { drawCw = false; locationC = cfsw.getLocation; completeC = false; } Rect groupRect = new Rect(windowRect.x + windowRect.width / 2 - 20.0f, windowRect.y + windowRect.height / 2 - 20.0f, windowRect.width / 2 + 20.0f, 60.0f); GUI.BeginGroup(groupRect); locationT = GUI.TextArea(new Rect(-5.0f, 0.0f, groupRect.width - groupRect.width / 7, 20.0f), locationT); if (GUI.Button(new Rect(groupRect.width - groupRect.width / 7 - 5.0f, 0.0f, groupRect.width / 7, 20.0f), "Get test set")) { drawTw = true; enabling = false; } locationC = GUI.TextArea(new Rect(-5.0f, 40.0f, groupRect.width - groupRect.width / 7, 20.0f), locationC); if (GUI.Button(new Rect(groupRect.width - groupRect.width / 7 - 5.0f, 40.0f, groupRect.width / 7, 20.0f), "Classifier set")) { drawCw = true; enabling = false; } GUI.EndGroup(); GUI.Label(new Rect(groupRect.x + groupRect.width / 2 - 10.0f, groupRect.y + groupRect.height + 20.0f, 20.0f, 20.0f), "K"); sK = k.ToString(); sK = GUI.TextField(new Rect(groupRect.x + groupRect.width / 2 - 10.0f, groupRect.y + groupRect.height + 40.0f, 20.0f, 20.0f), sK, 1); sK = Regex.Replace(sK, "[^a-zA-Z0-9 #!@]", "0"); k = int.Parse(sK); if (locationT != "") { if (k > 0 && new FileInfo(locationT).Extension == ".csv") { nextEnabled = true; } } GUI.enabled = nextEnabled; if (GUI.Button(new Rect(windowRect.width - windowRect.width / 8, windowRect.height - 20.0f, groupRect.width / 8, 20.0f), "Next")) { tdh = new Datahandler(locationT); if (locationC != "" && (new FileInfo(locationC).Extension == ".csv")) { cdh = new Datahandler(locationC); } pgState = programStates.LoadSecond; } GUI.enabled = true; break; case programStates.LoadSecond: tddv = new DrawDatasetValues(new Vector2(windowRect.x + windowRect.width - windowRect.width / 2 - 205.0f, windowRect.y + windowRect.height - windowRect.height / 2 - 150.0f), tdh.getDataTable); drawTw = drawCw = completeT = completeC = nextEnabled = false; pgState = programStates.SecondWindow; break; case programStates.SecondWindow: tddv.Draw(); if (tddv.theX != "" && tddv.theY != "" && tddv.theClassifier != "") { nextEnabled = true; } GUI.enabled = nextEnabled; if (GUI.Button(new Rect(windowRect.width - windowRect.width / 8, windowRect.height - 20.0f, (windowRect.width / 2) / 8, 20.0f), "Next")) { pgState = programStates.LoadDraw; } GUI.enabled = true; break; case programStates.LoadDraw: DataTable tTable = tdh.getDataTable; DataManager tdm = new DataManager(tTable, tTable.Columns[tddv.theX], tTable.Columns[tddv.theY], tTable.Columns[tddv.theClassifier], Calculator.minmax(tTable, tTable.Columns[tddv.theX]), Calculator.minmax(tTable, tTable.Columns[tddv.theY])); ClassifierColor.instantiate(tTable, tTable.Columns[tddv.theClassifier]); Attributes[] tdmAtts, cdmAtts; tdmAtts = tdm.CreateAttributes(); if (cdh != null) { DataManager cdm = new DataManager(cdh.getDataTable, tTable.Columns[tddv.theX], tTable.Columns[tddv.theY], Calculator.minmax(tTable, tTable.Columns[tddv.theX]), Calculator.minmax(tTable, tTable.Columns[tddv.theY])); cdmAtts = cdm.CreateAttributes(); foreach (Attributes cAtt in cdmAtts) { SpecialK Knearest = new SpecialK(tdmAtts, cAtt, k); cAtt.importK(Knearest.eucli, Knearest.cheby, Knearest.manhatt, true); } cAtts = cdmAtts; } else { foreach (Attributes tAtt in tdmAtts) { SpecialK Knear = new SpecialK(tdmAtts, tAtt, k); tAtt.importK(Knear.eucli, Knear.cheby, Knear.manhatt, false); } tAtts = tdmAtts; } pgState = programStates.Diagram; break; } }
private void DoMyWindow(int windowID) { switch(pgState) { case programStates.StartWindow: if(completeT) { drawTw = false; locationT = tfsw.getLocation; completeT = false; } if(completeC) { drawCw = false; locationC = cfsw.getLocation; completeC = false; } Rect groupRect = new Rect(windowRect.x + windowRect.width/2-20.0f, windowRect.y + windowRect.height/2 - 20.0f, windowRect.width/2+20.0f, 60.0f); GUI.BeginGroup(groupRect); locationT = GUI.TextArea(new Rect(-5.0f, 0.0f, groupRect.width - groupRect.width/7, 20.0f), locationT); if(GUI.Button(new Rect(groupRect.width - groupRect.width/7 - 5.0f, 0.0f, groupRect.width/7, 20.0f), "Get test set")) { drawTw = true; enabling = false; } locationC = GUI.TextArea(new Rect(-5.0f, 40.0f, groupRect.width - groupRect.width/7, 20.0f), locationC); if(GUI.Button(new Rect(groupRect.width - groupRect.width/7 - 5.0f, 40.0f, groupRect.width/7, 20.0f), "Classifier set")) { drawCw = true; enabling = false; } GUI.EndGroup(); GUI.Label(new Rect(groupRect.x + groupRect.width/2 - 10.0f, groupRect.y + groupRect.height + 20.0f, 20.0f, 20.0f), "K"); sK = k.ToString(); sK = GUI.TextField(new Rect(groupRect.x + groupRect.width/2 - 10.0f, groupRect.y + groupRect.height + 40.0f, 20.0f, 20.0f), sK, 1); sK = Regex.Replace(sK, "[^a-zA-Z0-9 #!@]", "0"); k = int.Parse(sK); if(locationT != "") { if(k > 0 && new FileInfo(locationT).Extension == ".csv") { nextEnabled = true; } } GUI.enabled = nextEnabled; if(GUI.Button(new Rect(windowRect.width - windowRect.width/8, windowRect.height - 20.0f, groupRect.width/8, 20.0f), "Next")) { tdh = new Datahandler(locationT); if(locationC != "" && (new FileInfo(locationC).Extension == ".csv")) { cdh = new Datahandler(locationC); } pgState = programStates.LoadSecond; } GUI.enabled = true; break; case programStates.LoadSecond: tddv = new DrawDatasetValues(new Vector2(windowRect.x + windowRect.width - windowRect.width/2 - 205.0f, windowRect.y + windowRect.height - windowRect.height/2 - 150.0f), tdh.getDataTable); drawTw = drawCw = completeT = completeC = nextEnabled = false; pgState = programStates.SecondWindow; break; case programStates.SecondWindow: tddv.Draw(); if(tddv.theX != "" && tddv.theY != "" && tddv.theClassifier != "") { nextEnabled = true; } GUI.enabled = nextEnabled; if(GUI.Button(new Rect(windowRect.width - windowRect.width/8, windowRect.height - 20.0f, (windowRect.width/2)/8, 20.0f), "Next")) { pgState = programStates.LoadDraw; } GUI.enabled = true; break; case programStates.LoadDraw: DataTable tTable = tdh.getDataTable; DataManager tdm = new DataManager(tTable, tTable.Columns[tddv.theX], tTable.Columns[tddv.theY], tTable.Columns[tddv.theClassifier], Calculator.minmax(tTable, tTable.Columns[tddv.theX]), Calculator.minmax(tTable, tTable.Columns[tddv.theY])); ClassifierColor.instantiate(tTable, tTable.Columns[tddv.theClassifier]); Attributes[] tdmAtts, cdmAtts; tdmAtts = tdm.CreateAttributes(); if(cdh != null) { DataManager cdm = new DataManager(cdh.getDataTable, tTable.Columns[tddv.theX], tTable.Columns[tddv.theY], Calculator.minmax(tTable, tTable.Columns[tddv.theX]), Calculator.minmax(tTable, tTable.Columns[tddv.theY])); cdmAtts = cdm.CreateAttributes(); foreach(Attributes cAtt in cdmAtts) { SpecialK Knearest = new SpecialK(tdmAtts, cAtt, k); cAtt.importK(Knearest.eucli, Knearest.cheby, Knearest.manhatt, true); } cAtts = cdmAtts; } else { foreach(Attributes tAtt in tdmAtts) { SpecialK Knear = new SpecialK(tdmAtts, tAtt, k); tAtt.importK(Knear.eucli, Knear.cheby, Knear.manhatt, false); } tAtts = tdmAtts; } pgState = programStates.Diagram; break; } }