Sie sind auf Seite 1von 34

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace BawalSumuko
{
class Program
{
static void Main(string[] args)
{
string username = "";
string password = "";
string replyw = "";
string replyt = "";
string replyq = "";
string replye = "";
string reply = "";
string replyg = "";
string dfg = "";
string month = "";

string apass = "";


string aname = "";

string signup_uname = "";


string signup_pword = "";
string emp_name1 = "";
string aapass = "";
string aaname = "";
string yon = "";

MENU:
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\t ***************************************************");
Console.WriteLine("\t<****** Choose your position ******>");
Console.WriteLine("\t ***************************************************");
Console.WriteLine("\n");
Console.WriteLine("\t\t\t******************************");
Console.WriteLine("\t\t\t* a. Admin *");
Console.WriteLine("\t\t\t* b. Officer *");
Console.WriteLine("\t\t\t* c. Exit *");
Console.WriteLine("\t\t\t******************************");
Console.WriteLine("\n");
Console.Write("\n\t\t\tENTER HERE : ");
replyt = Convert.ToString(Console.ReadLine());
string username1 = "";
string password1 = "";
string admin_name1 = "";
string admin_namee1 = "";

if (replyt == "c" || replyt == "C" || replyt == "c." || replyt == "C.")


{
return;
}
if (replyt == "a" || replyt == "A" || replyt == "a." || replyt == "A.")
{

LOGIN:
Console.Clear();
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\t\t\t**************************************");
Console.WriteLine("\t\t\t* LOG IN! *");
Console.WriteLine("\t\t\t**************************************");

Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n");
Console.Write("\n\t\t\tEnter FirstName : ", admin_name1);
admin_name1 = Convert.ToString(Console.ReadLine());
Console.Write("\n\t\t\tENTER USERNAME : ");
username = Convert.ToString(Console.ReadLine());

Console.Write("\n\t\t\tENTER PASSWORD : ");


password = Convert.ToString(Console.ReadLine());

if ((string.IsNullOrEmpty(admin_name1)) || (string.IsNullOrEmpty(username)) ||
(string.IsNullOrEmpty(password)))
{
Console.WriteLine("\n\n\n\t\t\t\t\tinvalid action!");
Console.ReadLine();
rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto LOGIN;

}
if (r == "b" || r == "B")
{
goto MENU;
}
else
{
goto rr;
}

string plm = (@"C:\Users\Personal\Desktop\acc\" + admin_name1 + ".txt");


if (File.Exists(plm))
{

using (StreamReader sr = new


StreamReader(File.Open(@"C:\Users\Personal\Desktop\acc\" + admin_name1 + ".txt",
FileMode.Open)))
{

username1 = sr.ReadLine();
password1 = sr.ReadLine();
admin_namee1 = sr.ReadLine();

}
if ((username != username1 || password != password1))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Username and Password does not matched!");
Console.ForegroundColor = ConsoleColor.Yellow;
rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto LOGIN;

}
if (r == "b" || r == "B")
{
goto MENU;
}
else
{
goto rr;
}
}

if (!File.Exists(plm))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Username and Password does not matched!");
Console.ForegroundColor = ConsoleColor.Yellow;
rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto LOGIN;

}
if (r == "b" || r == "B")
{
goto MENU;
}
else
{
goto rr;
}
}

if ((username == username1 && password == password1))


{
adminmenu:
Console.Clear();

Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* ADMIN MENU *");
Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\n");
Console.WriteLine("\t\t\t**********************************");
Console.WriteLine("\t\t\t* You want: *");
Console.WriteLine("\t\t\t**********************************");
Console.WriteLine("\n");
Console.WriteLine("\t\t\t**********************************");
Console.WriteLine("\t\t\t* a. To add Users *");
Console.WriteLine("\t\t\t* b. Log out *");
Console.WriteLine("\t\t\t**********************************");
Console.Write("\n\t\t\tEnter Here : ");
reply = Convert.ToString(Console.ReadLine());

if (reply == "a" || reply == "A" || reply == "a." || reply == "A.")


{
Console.WriteLine("\n\t\t\t1. add admin");
Console.WriteLine("\t\t\t2. add officer");
Console.Write("\n\t\t\tEnter Here : ");
replyq = Convert.ToString(Console.ReadLine());
if (replyq == "1" || replyq == "1.")
{
ulit:
Console.Clear();

Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* Sign Up Here: *");
Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\tAdmin's FirstName : ");
admin_name1 = Convert.ToString(Console.ReadLine());

Console.Write("\n\t\tUsername : ");
aname = Convert.ToString(Console.ReadLine());

Console.Write("\n\t\tPassword : ");
apass = Convert.ToString(Console.ReadLine());

if ((string.IsNullOrEmpty(admin_name1)) || (string.IsNullOrEmpty(aname)) ||
(string.IsNullOrEmpty(aname)))
{

Console.WriteLine("\n\n\n\t\t\t\tinvalid action!");
Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Cyan;
rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto ulit;

}
if (r == "b" || r == "B")
{
goto adminmenu;
}
else
{
goto rr;
}

string bnm = (@"C:\Users\Personal\Desktop\acc\" + admin_name1 + ".txt");


if (File.Exists(bnm))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\n\n\t\t\tAccount Already Existing!!");
Console.ForegroundColor = ConsoleColor.Cyan;
rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto ulit;

}
if (r == "b" || r == "B")
{
goto adminmenu;
}

else
{
goto rr;
}

}
if (!File.Exists(bnm))
{
using (StreamWriter sw = File.CreateText(bnm))
{
sw.WriteLine("" + aname);
sw.WriteLine("" + apass);
sw.WriteLine("" + admin_name1);

Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("\n\t\t\t\t\tSuccess!");
Console.ForegroundColor = ConsoleColor.DarkMagenta;
Console.WriteLine("Press Enter to back to admin menu");
Console.ReadLine();
goto adminmenu;
}

Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("You want to Continue? Yes or no?");
replyw = Convert.ToString(Console.ReadLine());

if (replyw == "yes" || replyw == "y" || replyw == "YES" || replyw == "Y")


{

goto adminmenu;
}

if (replyw == "no" || replyw == "n" || replyw == "NO" || replyw == "N")


{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Gray;
Console.WriteLine("\t\t\t\tThank You!!!");
Console.ReadLine();
return;

}
else if (replyq == "2" || replyq == "2.")
{
emp:
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* Sign Up Here: *");

Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\tFirstName : ");
emp_name1 = Convert.ToString(Console.ReadLine());
Console.Write("\n\t\tUsername : ");
signup_uname = Convert.ToString(Console.ReadLine());
Console.Write("\n\t\tPassword : ");
signup_pword = Convert.ToString(Console.ReadLine());
if ((string.IsNullOrEmpty(emp_name1)) || (string.IsNullOrEmpty(signup_uname)) ||
(string.IsNullOrEmpty(signup_pword)))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\n\n\n\t\t\t\tinvalid action!");
rr:
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto emp;

}
if (r == "b" || r == "B")
{
goto adminmenu;
}
else
{

goto rr;
}

string bhy = (@"C:\Users\Personal\Desktop\accc\" + emp_name1 + ".txt");


if (File.Exists(bhy))
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Sorry, Account is Already exist");
rr:
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto emp;

}
if (r == "b" || r == "B")
{
goto adminmenu;
}
else
{
goto rr;
}

}
if (!File.Exists(bhy))
{
using (StreamWriter sw = File.CreateText(bhy))
{
sw.WriteLine("" + signup_uname);
sw.WriteLine("" + signup_pword);

Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("\n\n\t\t\t\tSuccess");
Console.ForegroundColor = ConsoleColor.DarkMagenta;
Console.WriteLine("Press Enter to back to admin menu");
Console.ReadLine();
goto adminmenu;

}
}
if (reply == "b" || reply == "B" || reply == "b." || reply == "B.")
{
rosa:
Console.WriteLine("Are you Sure?Yes or No");
yon = Console.ReadLine();
if (yon == "y" || yon == "yes" || yon == "Y" || yon == "YES")
{
goto MENU;
}
if (yon == "n" || yon == "no" || yon == "N" || yon == "NO")
{
goto adminmenu;
}
else
{
goto rosa;
}
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\n\n\t\t\t\tYou Entered is invalid");
Console.ReadLine();
goto adminmenu;
}

}
}
if (replyt == "b" || replyt == "B")
{
string aaname1 = "";
string aapass1 = "";

SIGNIN:
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* Sign In Here: *");
Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\tFirstName : ");
emp_name1 = Console.ReadLine();
Console.Write("\n\t\tUsername : ");
aaname = Convert.ToString(Console.ReadLine());
Console.Write("\n\t\tPassword : ");
aapass = Convert.ToString(Console.ReadLine());
if ((string.IsNullOrEmpty(emp_name1)) || (string.IsNullOrEmpty(aaname)) ||
(string.IsNullOrEmpty(aapass)))
{

Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\n\n\t\t\tinvalid action!");
Console.ReadLine();
rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto SIGNIN;

}
if (r == "b" || r == "B")
{
goto MENU;
}
else
{
goto rr;
}

string plm = (@"C:\Users\Personal\Desktop\accc\" + emp_name1 + ".txt");


if (File.Exists(plm))
{

using (StreamReader sr = new


StreamReader(File.Open(@"C:\Users\Personal\Desktop\accc\" + emp_name1 + ".txt", FileMode.Open)))
{

aaname1 = sr.ReadLine();
aapass1 = sr.ReadLine();

}
if (aaname != aaname1 || aapass != aapass1)
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Username and Password does not matched!");
Console.ForegroundColor = ConsoleColor.Yellow;
rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto SIGNIN;
}
if (r == "b" || r == "B")
{
goto MENU;
}
else
{
goto rr;
}
}
}
if (!File.Exists(plm))
{

Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Username and Password does not matched!");
Console.ForegroundColor = ConsoleColor.Cyan;

rr:
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto SIGNIN;

}
if (r == "b" || r == "B")
{
goto MENU;
}
else
{
goto rr;
}
}

if ((aaname == aaname1 && aapass == aapass1))


{
string aaa = "";
string enterr = "";
string ddd = "";
string eee = "";
string fff = "";
string emp_name = "";
string emp_pos = "";
string agez = "";
string gender = "";
string bday = "";
string bplace = "";
string adrs = "";
string cn = "";
string email = "";

double hr_work = 0;
double ovt = 0;
double wages = 0;
double gross_pay = 0;
double basic_salary = 0;

double osrr = 1.5;


double osr = 0;
double os = 0;

double sss = 0;
double phil = 0;
double pag_ibig = 0;

double deduc = 0;
double net_pay = 0;

officermenu:
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* MENU *");
Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\n\t\t\t\ta. Add Employee");
Console.WriteLine("\n\t\t\t\tb. List of Employees");
Console.WriteLine("\n\t\t\t\tc. Delete Account");
Console.WriteLine("\n\t\t\t\td. Log out");
Console.Write("\n\n\t\t\t\tEnter Here : ");
aaa = Console.ReadLine();
if (aaa == "a" || aaa == "A")
{

again:
Console.Clear();

Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* INFORMATION: *");
Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\tEmployee's Name : ");
emp_name = Console.ReadLine();
pp:
Console.Write("\n\t\tEmployee's Position : ");
emp_pos = Console.ReadLine();
if (emp_pos == "documentation" || emp_pos == "docu" || emp_pos ==
"Documentation" || emp_pos == "Docu")
{
basic_salary = 19000;
}
else if (emp_pos == "developer" || emp_pos=="Developer")
{
basic_salary = 20000;
}
else if (emp_pos == "tester" || emp_pos == "Tester")
{
basic_salary = 18000;
}
else if (emp_pos == "researcher" || emp_pos =="Researcher")
{
basic_salary = 17000;
}
else if (emp_pos == "system analyst" || emp_pos == "System Analyst")
{
basic_salary = 15000;
}
else if (emp_pos == "financial manager" || emp_pos == "Financial Manager" || emp_pos
== "Financial manager")
{
basic_salary = 16000;
}
else
{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\n\t\t\t\tNot a position");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.ReadLine();
goto pp;
}
Console.Write("\n\t\tAge : ");
agez = Console.ReadLine();
Console.Write("\n\t\tGender : ");
gender = Console.ReadLine();

Console.Write("\n\t\tBirthDay : ");
bday = Console.ReadLine();
Console.Write("\n\t\tBirthPlace : ");
bplace= Console.ReadLine();
Console.Write("\n\t\tAddress : ");
adrs = Console.ReadLine();
Console.Write("\n\t\tContact Number : ");
cn = Console.ReadLine();
Console.Write("\n\t\tEmail : ");
email = Console.ReadLine();
string path = @"C:\Users\Personal\Desktop\export\rosa.txt";
if (File.Exists(path))
{
using (StreamWriter sw = File.AppendText(path))
{
sw.WriteLine(" ");
sw.Write(" ");
sw.Write(emp_name);
sw.Write(" ");
sw.Write(emp_pos);

}
}
string rrr = @"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt";

if (File.Exists(rrr))
{

Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Sorry the acc does exist");
Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Cyan;
xxx:
Console.WriteLine("a. Again \nb. Back to menu");
string zzz = Console.ReadLine();
if (zzz == "a" || zzz == "A")
{
goto again;
}
if (zzz == "b" || zzz == "B")
{
goto officermenu;
}
else
{
goto xxx;
}
}
if (!File.Exists(rrr))
{
using (StreamWriter sw = File.CreateText(rrr))
{
sw.WriteLine("" + emp_name);
sw.WriteLine("" + emp_pos);
sw.WriteLine("" + agez);
sw.WriteLine("" + gender);
sw.WriteLine("" + bday);
sw.WriteLine("" + bplace);
sw.WriteLine("" + adrs);
sw.WriteLine("" + cn);
sw.WriteLine("" + email);
}
}
rr:
Console.WriteLine("a. Create Payroll Transaction \nb. Go back");
replyg = Console.ReadLine();
if (replyg == "b" || replyg == "B")
{
goto officermenu;
}
if (replyg == "a" || replyg == "A")
{
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* Payroll Transaction: *");

Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\t for the month of: ");
month = Console.ReadLine();

Console.Write("\n\n\t\tEnter Total Hours for the Month : ");


hr_work = Convert.ToDouble(Console.ReadLine());
Console.Write("\n\t\tBasic Salary : {0}", basic_salary);

wages = (basic_salary / 240);


Console.Write("\n\t\tSalary Rate (per hr) : P {0}", wages);
Console.Write("\n\t\tEnter Total of Overtime : ");
ovt = Convert.ToDouble(Console.ReadLine());
osr = (wages * osrr);
Console.Write("\n\t\tOvertime Salary Rate (per hr) : P {0}", osr);
os = (ovt * osr);
Console.Write("\n\t\tOvertime Salary : P {0}", os);

gross_pay = (((basic_salary / 240) * hr_work) + os);


Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("\n\t\tGross Pay : P {0}", gross_pay);

Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\n\n\t\t\t\t========|Deductions|=========");
sss = (gross_pay * .11);
Console.Write("\n\t\tEnter SSS Contribution : {0}", sss);
pag_ibig = (gross_pay * .2);
Console.Write("\n\t\tEnter PAG-IBIG Contribution : {0}", pag_ibig);
phil = (gross_pay * .015);
Console.Write("\n\t\tEnter PHILHEALTH Contribution : {0}", phil);

deduc = (sss + pag_ibig + phil);


Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\t\t\tTotal Deductions : P {0}", deduc);
Console.ReadLine();

net_pay = (gross_pay - deduc);


Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\t\t\tNet_pay : P {0}", net_pay);
Console.ReadLine();
string abc = @"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt";

if (!File.Exists(abc))
{
using (StreamWriter sw = File.CreateText(abc))
{
sw.WriteLine("" + month);
sw.WriteLine("" + hr_work);
sw.WriteLine("" + ovt);
sw.WriteLine("" + osr);
sw.WriteLine("" + os);
sw.WriteLine("" + basic_salary);
sw.WriteLine("" + wages);

sw.WriteLine("" + gross_pay);

sw.WriteLine("" + sss);
sw.WriteLine("" + pag_ibig);
sw.WriteLine("" + phil);

sw.WriteLine("" + deduc);
sw.WriteLine("" + net_pay);
}
Console.Clear();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("\t\t\t\tSuccessful");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\t\t\t\tPress Enter");
enterr = Console.ReadLine();
goto officermenu;
}
}
else
{
goto rr;
}
}
if (aaa == "b" || aaa == "B")
{

SIRCH:

string[] lines = File.ReadAllLines(@"C:\Users\Personal\Desktop\export\rosa.txt");

int i;

for (i = 0; i < 0; i++)


{
i = i + 1;
}
Console.Clear();
foreach (string liness in lines)
{

Console.WriteLine("\t{0}", i + liness);
i++;
}
backback:
Console.ForegroundColor = ConsoleColor.DarkMagenta;
Console.WriteLine("\n\n\n\n\n\t\t\t*Enter name to search*");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.Write("\t\t\tSearch : ");
emp_name = Console.ReadLine();

if (!File.Exists(@"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt"))


{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("\t\t\tAccount does not exist");
rr:
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("a. Again? \nb. Go back");
string r = Console.ReadLine();
if (r == "a" || r == "A")
{
goto backback;
}
if (r == "b" || r == "B")
{
goto officermenu;
}
else
{
goto rr;
}

}
if (File.Exists(@"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt"))
{
string a = "";
string b = "";
string c = "";
string d = "";

string s = "";
string t = "";
string u = "";
string v = "";
string w = "";

using (StreamReader sr = new


StreamReader(File.Open(@"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt",
FileMode.Open)))
{
a = sr.ReadLine();
b = sr.ReadLine();
c = sr.ReadLine();
d = sr.ReadLine();

s = sr.ReadLine();
t = sr.ReadLine();
u = sr.ReadLine();
v = sr.ReadLine();
w = sr.ReadLine();

}
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* INFORMATION *");

Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\tEmployee's Name : {0} ", a);
Console.Write("\n\t\tEmployee's Position : {0} ", b);
Console.Write("\n\t\tAge : {0} ", c);
Console.Write("\n\t\tGender : {0} ", d);
Console.Write("\n\t\tBirthDay : {0} ", s);
Console.Write("\n\t\tBirthPlace : {0} ", t);
Console.Write("\n\t\tAddress : {0} ", u);
Console.Write("\n\t\tContact Number : {0} ", v);
Console.Write("\n\t\tEmail : {0} ", w);
Console.WriteLine("\n");

Console.WriteLine("\n\t\ta. Edit Information");


Console.WriteLine("\n\t\tb. Go to Payroll Transaction");
Console.WriteLine("\n\t\tc. Go back");
Console.Write("\n\t\tEnter Here : ");
ddd = Console.ReadLine();
if (ddd == "a" || ddd == "A")
{

if (File.Exists(@"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt"))


{

File.Delete(@"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt");


}

Console.Clear();

Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* INFORMATION: *");

Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\tEmployee's Name : {0}", emp_name);
pp:
Console.Write("\n\t\tEmployee's Position : ");
emp_pos = Console.ReadLine();
if (emp_pos == "documentation" || emp_pos == "docu" || emp_pos ==
"Documentation" || emp_pos == "Docu")
{
basic_salary = 19000;
}
else if (emp_pos == "developer" || emp_pos == "Developer")
{
basic_salary = 20000;
}
else if (emp_pos == "tester" || emp_pos == "Tester")
{
basic_salary = 18000;
}
else if (emp_pos == "researcher" || emp_pos == "Researcher")
{
basic_salary = 17000;
}
else if (emp_pos == "system analyst" || emp_pos == "System Analyst")
{
basic_salary = 15000;
}
else if (emp_pos == "financial manager" || emp_pos == "Financial Manager" ||
emp_pos == "Financial manager")
{
basic_salary = 16000;
}
else
{
Console.WriteLine("Not a position");
Console.ReadLine();
goto pp;
}

Console.Write("\n\t\tAge : ");
agez = Console.ReadLine();
Console.Write("\n\t\tGender : ");
gender = Console.ReadLine();
Console.Write("\n\t\tBirthDay : ");
bday = Console.ReadLine();

Console.Write("\n\t\tBirthPlace : ");
bplace = Console.ReadLine();
Console.Write("\n\t\tAddress : ");
adrs = Console.ReadLine();

Console.Write("\n\t\tContact Number : ");


cn = Console.ReadLine();

Console.Write("\n\t\tEmail : ");
email = Console.ReadLine();
string ooo = @"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt";

if (!File.Exists(ooo))
{
using (StreamWriter sw = File.CreateText(ooo))
{
sw.WriteLine("" + emp_name);
sw.WriteLine("" + emp_pos);
sw.WriteLine("" + agez);
sw.WriteLine("" + gender);
sw.WriteLine("" + bday);
sw.WriteLine("" + bplace);
sw.WriteLine("" + adrs);
sw.WriteLine("" + cn);
sw.WriteLine("" + email);
}
}

}
if (ddd == "c" || ddd == "C")
{
goto officermenu;
}

if (ddd == "b" || ddd == "B")


{
Console.Clear();
if (!File.Exists(@"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt"))
{
string mm = "";
string e = "";
string f = "";
string g = "";
string h = "";
string r = "";
string j = "";
string k = "";

string l = "";
string m = "";
string n = "";

string p = "";
string q = "";
Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* Payroll Transaction *");

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t for the month of: {0}",mm);

Console.WriteLine("\n\n\t\tHours for the Month : {0} hrs", e);


Console.WriteLine("\t\tTotal of Overtime : {0} hr/hrs ", f);
Console.WriteLine("\t\tOvertime Salary Rate(per hr) : P {0} ", g);
Console.WriteLine("\t\tOvertime Salary : P {0} ", h);
Console.WriteLine("\t\tBasic Salary : P {0} ", r);
Console.WriteLine("\t\tSalary Rate(per hr) : P {0} ", j);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\n\t\tGross Pay : P {0} ", k);

Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\n\nDEDUCTIONS:");
Console.WriteLine("\n\t\tSSS Contribution : P {0} ", l);
Console.WriteLine("\t\tPAG-IBIG Contribution : P {0} ", m);
Console.WriteLine("\t\tPHILHEALTH Contribution : P {0} ", n);

Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\n\t\tTotal Deductions : P {0} ", p);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\n\t\tNet Pay : P {0} ", q);
Console.ReadLine();
}
if (File.Exists(@"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt"))
{
string mm = "";
string e = "";
string f = "";
string g = "";
string h = "";
string r = "";
string j = "";
string k = "";

string l = "";
string m = "";
string n = "";

string p = "";
string q = "";
using (StreamReader sr = new
StreamReader(File.Open(@"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt",
FileMode.Open)))
{
mm = sr.ReadLine();
e = sr.ReadLine();
f = sr.ReadLine();
g = sr.ReadLine();
h = sr.ReadLine();
r = sr.ReadLine();
j = sr.ReadLine();
k = sr.ReadLine();

l = sr.ReadLine();
m = sr.ReadLine();
n = sr.ReadLine();

p = sr.ReadLine();
q = sr.ReadLine();
}
Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* Payroll Transaction *");

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t for the month of: {0}", mm);

Console.WriteLine("\n\n\t\tHours for the Month : {0} hrs", e);


Console.WriteLine("\t\tTotal of Overtime : {0} hr/hrs ", f);
Console.WriteLine("\t\tOvertime Salary Rate(per hr) : P {0} ", g);
Console.WriteLine("\t\tOvertime Salary : P {0} ", h);
Console.WriteLine("\t\tBasic Salary : P {0} ", r);
Console.WriteLine("\t\tSalary Rate(per hr) : P {0} ", j);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\n\t\tGross Pay : P {0} ", k);

Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\n\n\t\tDEDUCTIONS:");
Console.WriteLine("\n\t\tSSS Contribution : P {0} ", l);
Console.WriteLine("\t\tPAG-IBIG Contribution : P {0} ", m);
Console.WriteLine("\t\tPHILHEALTH Contribution : P {0} ", n);

Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\n\t\tTotal Deductions : P {0} ", p);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\n\t\tNet Pay : P {0} ", q);
Console.ReadLine();
}

}
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\na. Edit Payroll Transaction");
Console.WriteLine("\nb. Back to search");
Console.WriteLine("\nc. Back to menu");
Console.Write("Enter Here : ");
eee = Console.ReadLine();

if (eee == "a" || eee == "A")


{
if (File.Exists(@"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt"))
{

File.Delete(@"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt");


}
Console.Clear();
Console.ForegroundColor = ConsoleColor.Cyan;

Console.WriteLine("\t\t**************************************************");
Console.WriteLine("\t\t* Payroll Transaction: *");

Console.WriteLine("\t\t**************************************************");
Console.Write("\n\t\t for the month of: ");
month = Console.ReadLine();
Console.Write("\n\n\t\tEnter Total Hours for the Month : ");
hr_work = Convert.ToDouble(Console.ReadLine());

Console.Write("\n\t\tBasic Salary : ");


basic_salary = Convert.ToInt32(Console.ReadLine());

wages = (basic_salary / 240);


Console.Write("\n\t\tSalary Rate (per hr) : P {0}", wages);
Console.Write("\n\t\tEnter Total of Overtime : ");
ovt = Convert.ToDouble(Console.ReadLine());
osr = (wages * osrr);
Console.Write("\n\t\tOvertime Salary Rate (per hr) : P {0}", osr);
os = (ovt * osr);
Console.Write("\n\t\tOvertime Salary : P {0}", os);

gross_pay = (((basic_salary / 240) * hr_work) + os);


Console.ForegroundColor = ConsoleColor.Yellow;
Console.Write("\n\t\tGross Pay : P {0}", gross_pay);

Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("\n\n\t\t\t\t========|Deductions|=========");
sss = (gross_pay * .11);
Console.Write("\n\t\tEnter SSS Contribution : {0}", sss);
pag_ibig = (gross_pay * .2);
Console.Write("\n\t\tEnter PAG-IBIG Contribution : {0}", pag_ibig);
phil = (gross_pay * .015);
Console.Write("\n\t\tEnter PHILHEALTH Contribution : {0}", phil);
deduc = (sss + pag_ibig + phil);
Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\t\t\tTotal Deductions : P {0}", deduc);
Console.ReadLine();

net_pay = (gross_pay - deduc);


Console.ForegroundColor = ConsoleColor.Yellow;
Console.WriteLine("\n\t\t\tNet_pay : P {0}", net_pay);
Console.ReadLine();
string abc = @"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt";

if (!File.Exists(abc))
{
using (StreamWriter sw = File.CreateText(abc))
{
sw.WriteLine("" + month);
sw.WriteLine("" + hr_work);
sw.WriteLine("" + ovt);
sw.WriteLine("" + osr);
sw.WriteLine("" + os);
sw.WriteLine("" + basic_salary);
sw.WriteLine("" + wages);

sw.WriteLine("" + gross_pay);

sw.WriteLine("" + sss);
sw.WriteLine("" + pag_ibig);
sw.WriteLine("" + phil);
sw.WriteLine("" + deduc);
sw.WriteLine("" + net_pay);
}
Console.Clear();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Successful");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Press Enter");
enterr = Console.ReadLine();
goto SIRCH;
}
}
if (eee == "b" || eee == "B")
{
goto SIRCH;
}
if (eee == "c" || eee == "C")
{
goto officermenu;
}

}
if (aaa == "c" || aaa == "C")
{
delete:
string[] lines = File.ReadAllLines(@"C:\Users\Personal\Desktop\export\rosa.txt");

int i;

for (i = 0; i < 0; i++)


{
i = i + 1;
}
Console.Clear();
foreach (string liness in lines)
{

Console.WriteLine("\t{0}", i + liness);
i++;
}

int ln = 0;
Console.WriteLine("Enter Line Number:");
ln = Convert.ToInt32(Console.ReadLine());
var file = new
List<string>(File.ReadAllLines(@"C:\Users\Personal\Desktop\export\rosa.txt"));
file.RemoveAt(ln);

File.WriteAllLines(@"C:\Users\Personal\Desktop\export\rosa.txt", file.ToArray());
Console.WriteLine("Enter name to delete Account");
emp_name = Console.ReadLine();
if (File.Exists(@"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt"))
{
File.Delete(@"C:\Users\Personal\Desktop\emp\pt\" + emp_name + ".txt");
}
if (File.Exists(@"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt"))
{
File.Delete(@"C:\Users\Personal\Desktop\emp\info\" + emp_name + ".txt");
Console.WriteLine("Successfully Deleted");
rr:
Console.WriteLine("\n\t\t\ta.Again?");
Console.WriteLine("\n\t\t\tb. Go back to menu");
Console.Write("\n\t\tEnter Here : ");
dfg = Console.ReadLine();
if (dfg == "a" || dfg == "A")
{
goto delete;
}
if (dfg == "b" || dfg == "B")
{
goto officermenu;
}
else
{
goto rr;
}

}
if (!File.Exists(@"C:\Users\Personal\Desktop\emp\" + emp_name + ".txt"))
{

Console.WriteLine("\n\t\tAccount doesn't Exist");


rr:
Console.WriteLine("\n\t\t\ta.Again?");
Console.WriteLine("\n\t\t\tb. Go back to menu");
Console.Write("\n\t\tEnter Here : ");
dfg = Console.ReadLine();
if (dfg == "a" || dfg == "A")
{
goto delete;
}
if (dfg == "b" || dfg == "B")
{
goto officermenu;
}
else
{
goto rr;
}

}
}
if (aaa == "d" || aaa == "D")
{
asd:
Console.WriteLine("Are you Sure? Yes or No");
fff = Console.ReadLine();
if (fff == "yes" || fff == "YES" || fff == "y" || fff == "Y")
{
goto MENU;
}
if (fff == "no" || fff == "N" || fff == "n" || fff == "No")
{
goto officermenu;

}
else
{
goto asd;
}
}
else
{
huhu:
Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Sorry, you entered is invalid");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Do you want to go back?Yes or No");
replye = Convert.ToString(Console.ReadLine());

if (replye == "yes" || replye == "y" || replye == "YES" || replye == "Y")


{
Console.Clear();
goto officermenu;

}
else if (replye == "no" || replye == "n" || replye == "NO" || replye == "N")
{
Console.Clear();
Console.WriteLine("Thank You");
Console.ReadLine();
return;
}
else
{
goto huhu;
}
}
}
}
else
{
huhu:
Console.Clear();
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Sorry, you entered is invalid");
Console.ForegroundColor = ConsoleColor.Cyan;
Console.WriteLine("Do you want to go back?Yes or No");
replye = Convert.ToString(Console.ReadLine());

if (replye == "yes" || replye == "y" || replye == "YES" || replye == "Y")


{
Console.Clear();
goto MENU;

}
else if (replye == "no" || replye == "n" || replye == "NO" || replye == "N")
{
Console.Clear();
Console.WriteLine("\t\t\tThank you");
Console.ReadLine();
return;
}
else
{
goto huhu;
}
}

}
}
}

Das könnte Ihnen auch gefallen