private void sendPersonInf(personInfo inf) { foreach (TcpInterface inter in listeners) { inter.onReqPerson(inf); } }
public void replaceDocx(personInfo inf) { DocX readFrom = DocX.Load(@".\template.docx"); foreach (var para in readFrom.Paragraphs) { if (para.Text.Contains("%isim%")) { para.ReplaceText("%isim%", getUpperString(inf.name), false); } if (para.Text.Contains("%soyisim%")) { para.ReplaceText("%soyisim%", getUpperString(inf.surname), false); } if (para.Text.Contains("%mail%")) { para.ReplaceText("%mail%", getUpperString(inf.mail), false); } if (para.Text.Contains("%telefon%")) { para.ReplaceText("%telefon%", getUpperString(inf.phone), false); } if (para.Text.Contains("%proje%")) { para.ReplaceText("%proje%", getUpperString(inf.proje), false); } if (para.Text.Contains("%id%")) { para.ReplaceText("%id%", getUpperString(inf.ID + ""), false); } } readFrom.SaveAs(new FileStream(@".\temp.docx", FileMode.OpenOrCreate)); }
//calculate the amount of tax public decimal amountTaxFunc(personInfo holdInfoPerson) { decimal amountTax = 0m; amountTax = holdInfoPerson.realEstateTax + holdInfoPerson.exciseTax; return(amountTax); }
public IEnumerator foundCorrectQR(personInfo inf) { yield return(null); Destroy(Instantiate(prefab_qrcorrect, transform.parent), 1.25f); print_component.printDocument(inf); }
public void onNewPerson(personInfo np) { if (string.IsNullOrEmpty(np.proje)) { np.proje = "Ziyaretçi"; } if (string.IsNullOrEmpty(np.phone)) { np.phone = "Belirtilmedi"; } if (string.IsNullOrEmpty(np.name)) { saveError(); } else if (string.IsNullOrEmpty(np.surname)) { saveError(); } else if (string.IsNullOrEmpty(np.mail)) { saveError(); } else { StartCoroutine(showLoadScreen()); StartCoroutine(tm.coInsertData(np)); } }
static void Main(string[] args) { personInfo InfoPeople = new personInfo(); InfoPeople.fName = "jeff"; Console.WriteLine("the fName is: " + " " + InfoPeople.fName); }
// INTERFACE public void onReqPerson(personInfo inf) { if (inf != null) { Debug.Log(inf.name + " " + inf.ID); } if (inf == null) { if (current_person_id > 1) { current_person_id = 1; button_previous.interactable = false; name_requested = null; UnityThread.executeCoroutine(requestPersonData(current_person_id)); Debug.Log("NULL --->>" + current_person_id); //UnityThread.executeCoroutine(closeLoadScene()); return; } } else if (name_requested == null) { UnityThread.executeCoroutine(setPersonData(inf)); } else if (inf.name == name_requested) { UnityThread.executeCoroutine(setPersonData(inf)); UnityThread.executeCoroutine(foundCorrectQR(inf)); name_requested = null; } UnityThread.executeCoroutine(closeLoadScene()); }
static void processJsonJavaScriptSerializer(String data) { JavaScriptSerializer js = new JavaScriptSerializer(); personInfo p = js.Deserialize <personInfo>(data); Console.WriteLine(p.age); }
public void requestPersonData(int id) { lock (locker) { if (client == null || !client.Connected) { return; } sw.WriteLine(CODE_GET + ""); sw.WriteLine(id + ""); //Debug.Log("req id: "+id); sw.Flush(); string name = sr.ReadLine(); if (string.IsNullOrEmpty(name) || name == "" + CODE_ERR) { sendPersonInf(null); } else { personInfo pi = new personInfo(); pi.ID = id; pi.name = name; //Debug.Log(name); pi.surname = sr.ReadLine(); pi.mail = sr.ReadLine(); pi.phone = sr.ReadLine(); pi.proje = sr.ReadLine(); //Debug.Log(name+" "+ pi.surname+" " + pi.mail+" "+ pi.phone+" " + pi.proje); sendPersonInf(pi); } } }
private void sendPersonSaved(personInfo inf) { foreach (TcpInterface inter in listeners) { inter.onPersonSaved(inf); } }
public bool RegisterUser(personInfo E) { bool result = true; int person = db.usp_Register(E.lastname, E.firstname, E.email, E.password, E.apartmentNumber, E.street, E.city, E.state, E.zipcode, E.homePhone, E.workPhone); return(result); }
//calculte the adjusted Gross public decimal adjustedGrossFunc(personInfo holdInfoPerson) { decimal adjGross = 0m; adjGross = holdInfoPerson.gross - holdInfoPerson.exemp * 1000 - 0.08m * holdInfoPerson.medicalExpenses - 0.25m * (holdInfoPerson.realEstateTax + holdInfoPerson.exciseTax) + 0.15m * holdInfoPerson.capital; return(adjGross); }
IEnumerator setPersonData(personInfo inf) { yield return(null); setInfosUI(inf.getData()); qr_component.setQR(inf.name + ":" + inf.ID); current_person_id = inf.ID; }
// Start is called before the first frame update public void savePersonInfo() { personInfo pi = new personInfo(); pi.name = fields[0].text; pi.surname = fields[1].text; pi.mail = fields[2].text; pi.phone = fields[3].text; pi.proje = fields[4].text; listener.onNewPerson(pi); closeWindow(); }
// INTERFACE public void OnPrintButton() { personInfo pi = new personInfo(); pi.ID = current_person_id; pi.name = fields[0].text; pi.surname = fields[1].text; pi.mail = fields[2].text; pi.phone = fields[3].text; pi.proje = fields[4].text; print_component.printDocument(pi); }
public int RegisterUser(personInfo p) { var perinfo = from b in db.People select b; List <Person> person = new List <Person>(); // List<personInfo> per = new List<personInfo>(); //bool result = true; int result = db.usp_Register(p.lastName, p.fisrtName, p.email, p.password, p.apartmentNumber, p.street, p.city, p.state, p.zipCode, p.homePhone, p.workPhone); return(result); }
//Penalty adjustment public void makeJudgment(ref taxInfo holdInfoTax, ref personInfo holdInfoPerson) { decimal ninetyPercent = 0.9m * holdInfoTax.taxOwed; decimal tenPercent = 0.1m * System.Math.Abs(holdInfoPerson.fedTaxWith - ninetyPercent); if (holdInfoPerson.fedTaxWith <= ninetyPercent) { holdInfoTax.penalty = tenPercent; } else { holdInfoTax.Refund = tenPercent; } }
public void printDocument(personInfo inf) { if (!isOsWindows) { return; } if (auto_print) { printer.PrintDocument(getPrintText(inf), @"C:\Users\utkua\OneDrive\Masaüstü\Dosyalar\Unity\QRUnity\header.png"); } else if (auto_dock) { try { if (!File.Exists(@".\template.docx")) { GetComponent <MainQR>().setErrMsg("Yazdırmak için geren 'template.docx' dosyası bulunamadı. Lürfen şablon hazırlayın veya şablonu kontrol edin."); return; } if (word != null && !word.HasExited) { word.Kill(); } string fileName = @".\temp.docx"; replaceDocx(inf); word = Process.Start("WINWORD.EXE", fileName); /* * * DocX doc = DocX.Create(fileName); * * doc.InsertParagraph("İsim: "+ getUpperString(inf.name)); * doc.InsertParagraph("Soyisim: "+ getUpperString(inf.surname)); * doc.InsertParagraph("Etkinlik: "+(inf.proje.ToLower()=="ziyaretçi"? getUpperString(inf.proje):(inf.proje.ToLower() == "görevli"? getUpperString(inf.proje):"Proje Sahibi"))); * doc.Save(); * word=Process.Start("WINWORD.EXE", fileName); */ } catch (Exception e) { GetComponent <MainQR>().setErrMsg(e.Message + "|" + e.StackTrace); } } }
public void insertPersonData(personInfo inf) { lock (locker) { if (inf == null) { return; } if (client == null || !client.Connected) { return; } sw.WriteLine(CODE_INSERT + ""); sw.WriteLine(inf.name + ""); sw.WriteLine(inf.surname + ""); sw.WriteLine(inf.mail + ""); sw.WriteLine(inf.phone + ""); sw.WriteLine(inf.proje + ""); sw.Flush(); string read = sr.ReadLine(); Debug.Log(read + " " + (read == CODE_GRANTED + "")); sendPersonSaved(inf); } }
public void setQR(personInfo inf) { setQR(inf.name + ":" + inf.ID); }
static void processJsonNewtonSoft(String data) { personInfo p = JsonConvert.DeserializeObject <personInfo>(data); Console.WriteLine(p.age); }
// INTERFACE public void onPersonSaved(personInfo inf) { UnityThread.executeCoroutine(closeLoadScene()); }
public string getPrintText(personInfo inf) { return("İsim: " + inf.name + "\nSoyisim: " + inf.surname + ""); }
public IEnumerator coInsertData(personInfo inf) { yield return(null); insertPersonData(inf); }
public void saveNewPerson(personInfo info) { StartCoroutine(showLoadScreen()); tm.insertPersonData(info); }