Exemple #1
0
        public ReturnObject Get_Doctor(int id)
        {
            ReturnObject returnData = new ReturnObject();

            try
            {
                using (var db = new ddiarydbEntities())
                {
                    Doctor_Master doctor = db.Doctor_Master.Where(x => x.Doctor_id == id).FirstOrDefault();

                    returnData.message     = "Successfull";
                    returnData.status_code = Convert.ToInt32(Status.Sucess);
                    returnData.data1       = doctor;
                }
            }
            catch (Exception ex)
            {
                ErrHandler.WriteError(ex.Message, ex);
                returnData.data1       = ex;
                returnData.message     = "Oops something went wrong! ";
                returnData.status_code = Convert.ToInt32(Status.Failed);
            }

            return(returnData);
        }