Ejemplo n.º 1
0
        /// <summary>
        /// Get Employee data count
        /// </summary>
        /// <returns></returns>
        public string GetEmployeeCount()
        {
            int   i           = _empRepository.Count();
            Int64 jEmployeeID = _empRepository.getEMployeesInfo(1);

            return(i.ToString());
        }
 public int Count(string companyCode, UserType type = UserType.Salesman)
 {
     if (type == UserType.Salesman)
     {
         return(_salesman.Count(companyCode));
     }
     else
     {
         return(_member.Count(companyCode, (int)type));
     }
 }
 public bool SaveOrUpdateSalesman(SalesmanModel salesman)
 {
     if (_salesman.Count(salesman.CompanyCode) > 1 && String.IsNullOrEmpty(salesman.Code))
     {
         throw new InvalidException("SIDC is required.");
     }
     if (salesman.Id == null || salesman.Id == 0)
     {
         SalesmanModel existSalesman = _salesman.Get(salesman.CompanyCode, salesman.Code).FirstOrDefault();
         if (existSalesman == null)
         {
             return(_salesman.Add(salesman));
         }
         else
         {
             throw new InvalidException($"{salesman.Code} already exist, try with another code.");
         }
     }
     else
     {
         return(_salesman.Update(salesman));
     }
 }
Ejemplo n.º 4
0
        public async Task <IActionResult> Count()
        {
            var result = await _employeeService.Count();

            return(Ok(result));
        }