示例#1
0
        public void SaveWCFERESTmployee(WCFEmployee Employee)
        {
            WCFEmployee_CFEXDB_DBContext wcfctxt = new WCFEmployee_CFEXDB_DBContext();

            wcfctxt.WCFEmployees.Add(Employee);
            wcfctxt.SaveChanges();

            //throw new NotImplementedException();
        }
示例#2
0
        public string UpdateWCFRESTEmployee(WCFEmployee Employee)
        {
            WCFEmployee_CFEXDB_DBContext wcfctxt = new WCFEmployee_CFEXDB_DBContext();
            WCFEmployee toupdt = wcfctxt.WCFEmployees.Find(Employee.Id);

            toupdt.Name         = Employee.Name;
            toupdt.Gender       = Employee.Gender;
            toupdt.DateOfBirth  = Employee.DateOfBirth;
            toupdt.EmployeeType = Employee.EmployeeType;
            toupdt.AnnualSalary = Employee.AnnualSalary;
            toupdt.HourlyPay    = Employee.HourlyPay;
            toupdt.HoursWorked  = Employee.HoursWorked;
            wcfctxt.SaveChanges();

            return(toupdt.Name + " details Updated successfully");
            //throw new NotImplementedException();
        }
示例#3
0
        //WCF Restfull service implementations

        public WCFEmployee GetWCFRESTEmployee(int Id)
        {
            WCFEmployee_CFEXDB_DBContext wcfctxt = new WCFEmployee_CFEXDB_DBContext();

            //WCFEmployee singleemp = from s in wcfctxt.WCFEmployees.AsQueryable()                                    .Where(s => s.Id == Id)
            //                        select new WCFEmployee
            //                        {
            //                            Id = s.Id,
            //                            Name = s.Name,
            //                            Gender = s.Gender,
            //                            DateOfBirth = s.DateOfBirth,
            //                            EmployeeType = s.EmployeeType,
            //                            AnnualSalary = s.AnnualSalary,
            //                            HourlyPay = s.HourlyPay,
            //                            HoursWorked = s.HoursWorked
            //                        };
            WCFEmployee singleemp = wcfctxt.WCFEmployees.Find(Id);

            return(singleemp);

            //throw new NotImplementedException();
        }