Ejemplo n.º 1
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);
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> GetAllPersonList(GetPersonelView view)
        {
            GetAllPersonListResponse response = _iPP_OTService.GetAllPersonList(view);

            return(Ok(response));
        }