public int UpdateAppointmentStatus(AppointmentCustomer appointmentCustomer, int TenantId)
        {
            MySqlCommand cmd = new MySqlCommand();
            int          i   = 0;

            try
            {
                conn.Open();
                cmd.Connection = conn;
                MySqlCommand cmd1 = new MySqlCommand("SP_HSUpdateAppoinmentStatus", conn);
                cmd1.Parameters.AddWithValue("@Appointment_ID", appointmentCustomer.AppointmentID);
                cmd1.Parameters.AddWithValue("@Tenant_ID", TenantId);
                cmd1.Parameters.AddWithValue("@_Status", appointmentCustomer.Status);

                cmd1.CommandType = CommandType.StoredProcedure;
                i = cmd1.ExecuteNonQuery();
                conn.Close();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }

            return(i);
        }
Exemplo n.º 2
0
        public ResponseModel UpdateAppointmentStatus([FromBody] AppointmentCustomer appointment)
        {
            AppointmentCaller newAppointment   = new AppointmentCaller();
            ResponseModel     objResponseModel = new ResponseModel();
            int    StatusCode    = 0;
            string statusMessage = "";

            try
            {
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromToken(_radisCacheServerAddress, SecurityService.DecryptStringAES(token));

                int result = newAppointment.updateAppoinment(new AppointmentServices(_connectioSting), appointment, authenticate.TenantId);
                StatusCode =
                    result == 0 ?
                    (int)EnumMaster.StatusCode.RecordNotFound : (int)EnumMaster.StatusCode.Success;
                statusMessage               = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)StatusCode);
                objResponseModel.Status     = true;
                objResponseModel.StatusCode = StatusCode;
                objResponseModel.Message    = statusMessage;
            }
            catch (Exception)
            {
                throw;
            }
            return(objResponseModel);
        }
Exemplo n.º 3
0
 public int updateAppoinment(IAppointment appointment, AppointmentCustomer appointmentCustomer, int TenantId)
 {
     _AppointmentRepository = appointment;
     return(_AppointmentRepository.UpdateAppointmentStatus(appointmentCustomer, TenantId));
 }