Exemplo n.º 1
0
        public IHttpActionResult GetPermanentIssued(string place, int outid)
        {
            dynamic employees;

            if (outid == 0)
            {
                employees = _context.Employee2.Where(m => m.Place == place && (m.issued == (false || m.issued == null))).ToList();
            }
            else
            {
                employees = _context.Employess.Where(m => m.Place == place && (m.issued == (false || m.issued == null))).ToList();
            }
            var reports = new List <PermanentReport>();

            foreach (var employee in employees)
            {
                //  if (employee.TOTAL != 0)
                {
                    var report = new PermanentReport()
                    {
                        Design    = employee.DESIGNATION,
                        ESI       = employee.ESI,
                        LIC       = employee.LIC,
                        PF        = employee.PF,
                        Total     = employee.TOTAL,
                        name      = employee.Name,
                        NetWages  = employee.NETTOTAL,
                        grade     = employee.GRADE,
                        EmpId     = employee.EmployeeId,
                        placename = employee.Place,
                        advance   = employee.SALADV,
                    };
                    reports.Add(report);
                }
            }

            if (reports == null)
            {
                return(BadRequest());
            }

            return(Ok(reports));
        }
Exemplo n.º 2
0
        public IHttpActionResult GetLocalOUt(int id, int outid)
        {
            dynamic employees;

            if (outid == 0)
            {
                employees = _context.Master4.Where(m => m.placeid == id.ToString() && (m.issued == null || m.issued == false)).ToList();
            }
            else
            {
                employees = _context.Master.Where(m => m.placeid == id.ToString() && (m.issued == null || m.issued == false)).ToList();
            }
            var place = _context.SiteAdmin.SingleOrDefault(m => m.Placeid == id);

            if (place == null)
            {
                return(BadRequest());
            }
            var reports = new List <PermanentReport>();

            foreach (var employee in employees)
            {
                //  if (employee.total != 0)
                {
                    var report = new PermanentReport()
                    {
                        Design    = employee.Design,
                        ESI       = employee.esi,
                        LIC       = employee.LIC,
                        PF        = employee.pf,
                        Total     = employee.grosswages,
                        name      = employee.name,
                        NetWages  = employee.netwages,
                        placename = place.PlaceName,
                        EmpId     = employee.EmpId,
                        advance   = employee.advance
                    };
                    reports.Add(report);
                }
            }

            return(Ok(reports));
        }