public GetAllPersonListResponse GetAllPersonList(GetPersonelView view)
        {
            var request = new RestRequest("api/PP_OT/GetAllPersonList", Method.POST, DataFormat.Json)
                          .AddJsonBody(view);
            var resp = Globals.ApiClient.Execute <GetAllPersonListResponse>(request);

            return(resp.Data);
        }
        public IActionResult GetAllPersonList(GetPersonelView view)
        {
            var response = _pp_otService.GetAllPersonList(view);

            if (response.isSuccess == false)
            {
                return(null);
            }
            return(Ok(response));
        }
Exemplo n.º 3
0
        public GetAllPersonListResponse GetAllPersonList(GetPersonelView view)
        {
            GetAllPersonListResponse response = new GetAllPersonListResponse();

            view.OvertimeDate = view.OvertimeDate == DateTime.MinValue ? DateTime.MinValue : view.OvertimeDate;
            try
            {
                if (view.OvertimeDate == DateTime.MinValue)
                {
                    response.isSuccess    = true;
                    response.PersonelList = null;
                }
                else
                {
                    DateTime OvertimeRequestDate = Convert.ToDateTime(view.OvertimeDate);
                    var      OvertimeDateFormat  = String.Format("{0:yyyy-MM-dd HH:mm:ss}", OvertimeRequestDate);

                    var PersonelList = _dbContext.sp_FM_GetPersonelList.FromSqlInterpolated($"EXECUTE dbo.sp_FM_GetPersonelList {OvertimeDateFormat},{view.DepartmentId}").ToList();
                    if (PersonelList != null && PersonelList.Count > 0)
                    {
                        response.isSuccess    = true;
                        response.PersonelList = PersonelList;
                    }
                    else
                    {
                        response.isSuccess    = false;
                        response.PersonelList = null;
                        response.ErrorMessage = "Hata oluştu tekrar deneyiniz!";
                    }
                }
            }
            catch (Exception)
            {
                response.isSuccess    = false;
                response.PersonelList = null;
                response.ErrorMessage = "Hata oluştu tekrar deneyiniz!";
            }
            return(response);
        }
Exemplo n.º 4
0
        public async Task <IActionResult> GetAllPersonList(GetPersonelView view)
        {
            GetAllPersonListResponse response = _iPP_OTService.GetAllPersonList(view);

            return(Ok(response));
        }