Exemple #1
0
        public bool Delete(long id)
        {
            Title singleDelete = GetSingle(id);

            if (singleDelete != null)
            {
                return(titleDb.Delete(singleDelete));
            }
            return(false);
        }
Exemple #2
0
        public bool Delete(long id)
        {
            BloodGroup singleDelete = GetSingle(id);

            if (singleDelete != null)
            {
                return(bpo.Delete(singleDelete));
            }
            return(false);
        }
Exemple #3
0
        public async Task <IActionResult> UpdatePatient([FromRoute] string regno, [FromBody] PatientDTO patient)
        {
            if (patient.payors.Count > 0)
            {
                var listOfPayors = new List <PatientPayorTypes>();
                foreach (var k in patient.payors)
                {
                    var current = k;
                    current.Patientid = regno;
                    listOfPayors.Add(current);
                }
                bool isDeleted = false;
                if (patientPayorTypes.count(x => x.Patientid == regno) > 0)
                {
                    isDeleted = patientPayorTypes.Delete(x => x.Patientid == regno);
                }

                patientPayorTypes.AddMultiples(listOfPayors.ToArray());

                //if (isDeleted)
                //{

                patient.Patientid = regno;
                var result = await ps.updatePatientInfo((Patient)patient);

                if (result)
                {
                    return(Ok(BaseResponse.GetResponse(null, "success", "00")));
                }
                // }
                return(BadRequest(BaseResponse.GetResponse(null, "request failed to update data try again", "99")));
            }

            patient.Patientid = regno;
            var ispatientUpdated = await ps.updatePatientInfo((Patient)patient);

            if (ispatientUpdated)
            {
                return(Ok(BaseResponse.GetResponse(null, "success", "00")));
            }



            return(BadRequest(BaseResponse.GetResponse(null, "request failed to update data try again", "99")));
        }