public void getturn() { if (i >= todayturn.Count || i < 0) { MessageBox.Show("invalid turn."); return; } x = todayturn[i]; if (x == null) { MessageBox.Show("wrong date"); } else { txtname.Text = x.name; txtfamilyname.Text = x.familyname; txtphone.Text = x.phone; txtdoctor.Text = x.doctorname; txtfilecode.Text = x.fileid; txtturn.Text = Convert.ToString(x.shomarenobat); employes newemp = new employes(x.doctorname, "doctor"); double money = Convert.ToDouble(returncost(x.work)) + Convert.ToDouble(readandwriteemp.getspecialsalary(newemp)); txtpayment.Text = money.ToString(); } }
public static string finalcheckout() { getallincome(); allsalary = readandwriteemp.getallsalary(); allmedcalex = mediacal_expenses.getallexpences(); string x = ""; allprofit = allincome - (allsalary + allmedcalex); allprofit = allprofit; if (allprofit < 0) { return(null); } else { pays.Clear(); string path = rateform.getpath() + @"\shareman.txt"; string pathemp = rateform.getpath() + "\\eminfo.txt"; string[] allinform1 = System.IO.File.ReadAllLines(path); string[] personinform; string[] allem = System.IO.File.ReadAllLines(pathemp); string[] eminfo; string [] payincome = System.IO.File.ReadAllLines(saveincomefile); string[] income; /*ist<Ipay> shareman = new List<Ipay>();*/ for (int i = 0; i < allinform1.Length; i++) { personinform = allinform1[i].Split('*'); //shareman.Add(new shareman(personinform[4])); pays.Add(readandwritesha.search(new shareman(personinform[4]))); } for (int i = 0; i < allem.Length; i++) { eminfo = allem[i].Split('*'); //shareman.Add(new employes(eminfo[4])); pays.Add(readandwriteemp.search(new employes(eminfo[4]))); } for (int i = 0; i < pays.Count; i++) { pays[i].checkout(); } for (int i = 0; i < payincome.Length; i++) { income = payincome[i].Split('*'); employes co = readandwriteemp.search(new employes(income[0], "doctor")); co.checksomeone(); } readandwriteemp.writeinlist(pays); readandwritesha.writeinlist(pays); } return(x); }
public static employes search(employes sha) { set(); for (int i = 0; i < empp.Count; i++) { if (empp[i].idnumber == sha.idnumber) { return(empp[i]); } } return(null); }
public static string getspecialsalary(employes cm) { set(); for (int i = 0; i < empp.Count; i++) { if (cm.name == empp[i].name && cm.Job == empp[i].Job) { return(Convert.ToString(empp[i].salary)); } } return(null); }