public int DeleteEmployeePanel(int key) { TblEmployeePanelMapping panelMapping = dbContext.TblEmployeePanelMapping.Where(x => x.EmployeePanelMappingId == key).FirstOrDefault(); panelMapping.IsActive = false; dbContext.TblEmployeePanelMapping.Update(panelMapping); return(dbContext.SaveChanges()); }
public int UpdateEmployeePanel(TblEmployeePanelMapping panelMapping) { if (dbContext.TblEmployeePanelMapping.Where(r => r.PanelGroupId == panelMapping.PanelGroupId && r.EmployeeId == panelMapping.EmployeeId && r.EmployeePanelMappingId != panelMapping.EmployeePanelMappingId && r.IsActive == panelMapping.IsActive).Count() > 0) { return(-1); } panelMapping.IsActive = true; dbContext.Entry(panelMapping).State = EntityState.Modified; dbContext.TblEmployeePanelMapping.Update(panelMapping); int result = dbContext.SaveChanges(); dbContext.Entry(panelMapping).State = EntityState.Detached; return(result); }
public int UpdateEmployeePanel(TblEmployeePanelMapping panelMapping) { return(MastersDAL.UpdateEmployeePanel(panelMapping)); }
public IActionResult EmployeePanel(int id, [FromBody] TblEmployeePanelMapping tblEmployee) { int result = _imasters.UpdateEmployeePanel(tblEmployee); return(Ok(result)); }
public IActionResult EmployeePanel(int id) { TblEmployeePanelMapping result = _imasters.GetEmployeePanelByCriteria(id); return(Ok(result)); }