public async Task <IActionResult> SerialNoCheckReplacementPart()
        {
            string serialNo = HttpContext.Request.Query["serialNo"].ToString();
            SerialNoCheckReplacementPartResponse response = _iReplacementPartService.SerialNoCheckReplacementPart(serialNo);

            return(Ok(response));
        }
        public SerialNoCheckReplacementPartResponse SerialNoCheckReplacementPart(string serialNo)
        {
            SerialNoCheckReplacementPartResponse response = new SerialNoCheckReplacementPartResponse();


            var SerialNumberCheck = _dbContext.sp_SSH_GetSkuBySerial.FromSqlInterpolated($"EXECUTE dbo.sp_SSH_GetSkuBySerial {serialNo}").ToList();

            if (SerialNumberCheck.Count == 0)
            {
                response.PartNo              = null;
                response.Path                = null;
                response.DocummentType       = null;
                response.DocummentRevisionno = null;
                response.ErrorMessage        = "Seri numarasını ait makine bulunamadı!";
                response.isSuccess           = false;
                return(response);
            }
            else
            {
                var GetPartNo = context.TblSshReplacementPartRepository.Get().Where(q => q.IzlemeKoduId == SerialNumberCheck[0].TrackingId && q.StokKoduId == SerialNumberCheck[0].StockId).FirstOrDefault();
                var GetPath   = context.TblSettingsRepository.Get().Where(q => q.SettingName == "TechnicalDocPathCoreMikroportal").FirstOrDefault();

                if (GetPartNo == null)
                {
                    response.PartNo       = null;
                    response.Path         = null;
                    response.ErrorMessage = "Parça bulunamadı.Yetkili servis ile iletişime geçiniz!";
                    response.isSuccess    = false;
                    return(response);
                }
                else
                {
                    var getDocumment     = context.MesEngineeringdrawingRepository.Get().Where(q => q.Code == Convert.ToString(GetPartNo.PartNo)).OrderByDescending(x => x.Revisionno).FirstOrDefault();
                    var getDocummentType = context.MesEngineeringdrawingsubtypeRepository.Get().Where(q => q.Id == 2).FirstOrDefault();

                    if (getDocumment == null)
                    {
                        response.PartNo              = null;
                        response.Path                = null;
                        response.DocummentType       = null;
                        response.DocummentRevisionno = null;
                        response.ErrorMessage        = "Parça bulunamadı. Yetkili servis ile iletişime geçiniz!";
                        response.isSuccess           = false;
                        return(response);
                    }
                    else
                    {
                        response.PartNo              = GetPartNo.PartNo;
                        response.Path                = GetPath.SettingValue;
                        response.DocummentType       = getDocummentType.Name;
                        response.DocummentRevisionno = getDocumment.Revisionno;

                        response.ErrorMessage = "";
                        response.isSuccess    = true;
                        return(response);
                    }
                }
            }
        }