-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.py
More file actions
55 lines (48 loc) · 1.65 KB
/
Employee.py
File metadata and controls
55 lines (48 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#1
from PermanentEmployee import Per_Emp
from connect import myconnect
from Validation import validation
class Employee:
_empname=""
_emptype=""
_empemail=""
_empsalary=""
def __init__(self):
self._empname = raw_input("enter name : ")
self._empemail=raw_input("enter email : ")
self._empmob=raw_input("enter mobile no : ")
self._emptype = raw_input("enter type : ")
self._empexp = int(input("enter experience :"))
self._empsalary = self.getsalary()
def getsalary(self):
if self._emptype=="P" or self._emptype=="p":
Opemp = Per_Emp()
return Opemp.calculatesalary(self._empexp)
else:
print("Invalid Employee. Please enter only 'p' or 'P'")
#3
@staticmethod
def addnote():
notes = raw_input("Enter Notes : ")
file = open("notes.txt", "a")
file.write(notes)
print "Note Added....."
file.close()
print("1. Add Emp")
print("2. Display Emp")
print("3. Add Notes")
choice = int(input("Enter your Choice:"))
if choice == 1:
c = Employee()
if validation.validateemail(c._empemail) and validation.validatetemobile(c._empmob):
obj = myconnect()
obj.savetodb(c._empname, c._empemail, c._empmob, c._emptype, c._empexp, c._empsalary)
else:
print "Invalid Email OR Mobile Number!"
elif choice==2:
obj = myconnect()
obj.display()
elif choice==3:
Employee.addnote()
else:
print("invalid choice")