internal static MbsResult GetEmployeeList() { ZBWorksDBContext dbContext = new ZBWorksDBContext(); List <ZB_USERDETAILS> EmployeeListDB = dbContext.ZBUSERDETAILs.Where(src => src.EmployeeName != null).ToList(); List <ZBUserDetails> EmployeeList = new List <ZBUserDetails>(); foreach (ZB_USERDETAILS item in EmployeeListDB) { EmployeeList.Add(new ZBUserDetails { EmployeeName = item.EmployeeName, Role = item.Role, Password = item.Password, InternalEmployeeID = item.InternalEmployeeID, }); } MbsResult retVal = new MbsResult(true, EmployeeList); return(retVal); }
internal void Validate() { HttpClient client = new HttpClient(); HttpRequestMessage msg = new HttpRequestMessage(HttpMethod.Get, "http://10.15.0.50/WebApplication1/api/Students9/Students"); HttpResponseMessage requst = client.SendAsync(msg).Result; String val = requst.Content.ReadAsStringAsync().Result; MbsResult mb = JsonConvert.DeserializeObject <MbsResult>(val); if (mb == null) { // return(mb.FirstMessage)); } else { var r = mb.Result; List <Student> ListStudents = JsonConvert.DeserializeObject <List <Student> >(r.ToString()); StudentList.Clear(); foreach (Student s in ListStudents) { if (s == null || string.IsNullOrEmpty(s.Name)) { continue; } StudentList.Add(s); } } }
internal static MbsResult GetEmployeeWorksheetDetailsByDate(string internalEmployeeId, long TaskDate, long TaskDate2) { using (ZBWorksDBContext dbContext = new ZBWorksDBContext()) { List <ZB_WORKS> matchingTask = dbContext.ZBWORKs.Where (src => src.InternalEmployeeID == internalEmployeeId && src.TaskDate == TaskDate || src.TaskDate == TaskDate2).ToList(); if (matchingTask == null) { return(new MbsResult(false, "No Tasks")); } List <ZbWorks> TaskList = new List <ZbWorks>(); foreach (var item in matchingTask) { TaskList.Add(new ZbWorks { TaskName = item.TaskName, TaskDate = item.TaskDate, InternalEmployeeID = item.InternalEmployeeID, EmployeeName = item.EmployeeName, InternalZBWorksId = item.InternalZBWorksId }); } MbsResult retVal = new MbsResult(true, TaskList); return(retVal); } }
internal string AddStudents() { if (Name == null || rollno == 0) { return("Please fill All the Felids"); } Student newstudent = new Student(); newstudent.Name = Name; newstudent.RollNo = RollNo; var parseMsg = JsonConvert.SerializeObject(newstudent); StringContent stringContent = new StringContent(parseMsg, Encoding.UTF8, "application/json"); HttpClient client = new HttpClient(); HttpRequestMessage msg = new HttpRequestMessage(HttpMethod.Post, "http://10.15.0.50/WebApplication1/api/Students9/Student"); msg.Content = stringContent; HttpResponseMessage req = client.SendAsync(msg).Result; var rtnvalue = req.Content.ReadAsStringAsync().Result; MbsResult mb = JsonConvert.DeserializeObject <MbsResult>(rtnvalue); if (mb.Status == false) { return(mb.FirstMessage); } else { var finalResult = mb.Result; Student newStudent = JsonConvert.DeserializeObject <Student>(finalResult.ToString()); // return "New Student Added successfully"; } return("New Student Added successfully"); }
public IHttpActionResult GetEmployeeWorksheetDetailsByDate(string internalEmployeeId, long TaskDate, long TaskDate2) { MbsResult retVal = EmployeeFacade.GetEmployeeWorksheetDetailsByDate(internalEmployeeId, TaskDate, TaskDate2); return(Ok(retVal)); }
public IHttpActionResult AddEmployeeTask([FromBody] List <ZbWorks> Newtask) { MbsResult retVal = EmployeeFacade.AddEmployeeTask(Newtask); return(Ok(retVal)); }
public IHttpActionResult UpdateEmployee([FromBody] ZBUserDetails updateEmployee) { MbsResult retVal = EmployeeFacade.UpdateEmployee(updateEmployee); return(Ok(retVal)); }
public IHttpActionResult GetEmployeeDetails(string internalEmployeeId) { MbsResult retVal = EmployeeFacade.GetEmployeeDetails(internalEmployeeId); return(Ok(retVal)); }
public IHttpActionResult GetEmployeeList() { MbsResult retVal = EmployeeFacade.GetEmployeeList(); return(Ok(retVal)); }
public IHttpActionResult AddEmployee([FromBody] ZBUserDetails newEmployee) { MbsResult retVal = EmployeeFacade.AddEmployee(newEmployee); return(Ok(retVal)); }
public IHttpActionResult AuthenticateEmployee([FromBody] ZBUserDetails employee) { MbsResult retVal = EmployeeFacade.AuthenticateEmployee(employee); return(Ok(retVal)); }
internal static MbsResult GetEmployeeDetails(string internalEmployeeId) { MbsResult retVal = DbEngine.GetEmployeeDetails(internalEmployeeId); return(retVal); }
internal static MbsResult GetEmployeeList() { MbsResult retVal = DbEngine.GetEmployeeList(); return(retVal); }
internal static MbsResult GetAllEmployees() { MbsResult retVal = DbEngine.GetAllEmployees(); return(retVal); }
internal static MbsResult GetEmployeeWorksheetDetailsByDate(string internalEmployeeId, long TaskDate, long TaskDate2) { MbsResult retVal = DbEngine.GetEmployeeWorksheetDetailsByDate(internalEmployeeId, TaskDate, TaskDate2); return(retVal); }