コード例 #1
0
        public void countDb()
        {
            DataDb db = new DataDb();

            db.Count();
        }
コード例 #2
0
        public void deleteDB(string cnic)
        {
            DataDb db = new DataDb();

            db.Delete(cnic);
        }
コード例 #3
0
        public void SearchDB(string name)
        {
            DataDb db = new DataDb();

            db.Searh(name);
        }
コード例 #4
0
        public void UpdateDB(string cnic, string name)
        {
            DataDb db = new DataDb();

            db.Update(cnic, name);
        }
コード例 #5
0
        public void ShowAllD()
        {
            DataDb db = new DataDb();

            db.ShowAll();
        }
コード例 #6
0
        public void Insert()
        {
            Employee emp = new Employee();

            Console.WriteLine("Enter Name of Employee");
            emp.name = Console.ReadLine();
            if (String.IsNullOrEmpty(emp.name))
            {
                Console.WriteLine("You have to enter something...try Again");
                Console.WriteLine("Enter Name of Employee");
                emp.name = Console.ReadLine();
            }

            Console.WriteLine("Enter Father Name of Employee");
            emp.father_name = Console.ReadLine();
            if (String.IsNullOrEmpty(emp.father_name))
            {
                Console.WriteLine("You have to enter something...try Again");
                Console.WriteLine("Enter Father Name of Employee");
                emp.father_name = Console.ReadLine();
            }
            Console.WriteLine("Enter Cnic of Employee");
            emp.cnic = Console.ReadLine();
            if (emp.cnic.Count() < 13)
            {
                Console.WriteLine("Invalid entry CNIC must be 13 digits....enter again");
                Console.WriteLine("Enter Cnic of Employee");
                emp.cnic = Console.ReadLine();
            }
            Console.WriteLine("Enter Mobile number of Employee");
            emp.mobile_no = Console.ReadLine();

            Console.WriteLine("Enter Current Address of Employee");
            emp.current_address = Console.ReadLine();
            if (String.IsNullOrEmpty(emp.current_address))
            {
                Console.WriteLine("You have to enter something...try Again");
                Console.WriteLine("Enter Current Address of Employee");
                emp.current_address = Console.ReadLine();
            }
            Console.WriteLine("Enter Permanent Address of Employee");
            emp.prmanent_address = Console.ReadLine();
            if (String.IsNullOrEmpty(emp.prmanent_address))
            {
                Console.WriteLine("You have to enter something...try Again");
                Console.WriteLine("Enter Permanent Address of Employee");
                emp.prmanent_address = Console.ReadLine();
            }
            Console.WriteLine("Enter Grade of Employee");
            emp.grade = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Enter type of employee...type P for Permanent,C for contract,D for dailywages");
            emp.type = Console.ReadLine();



            //insert in to list
            Utility.employeeList.Add(emp);
            Console.WriteLine("Inserted in List");
            //insert into Database
            DataDb db = new DataDb();

            db.Insert(emp);
        }