public ActionResult Put(IEnumerable<Provider> provider)
        {
            string toBeVoiced = string.Empty;
            try
            {
                foreach (var prov in provider)
                {
                    ProviderList newProvider = new ProviderList();

                    newProvider.ProviderID = prov.ProviderID;
                    newProvider.ProviderName = prov.ProviderName;
                    newProvider.Department = prov.Department;

                    providers.AddProvider(newProvider);
                }
                return new JsonResult { Data = new { Success = true } };
            }
            catch (Exception er)
            {
                string s1 = er.Message;
                return new JsonResult { Data = new { Success = false } };
            }
        }
        public void UpdateProvider(ProviderList providerList)
        {
            string providerID = string.Empty;
            string providerName = string.Empty;
            string department = string.Empty;

            try
            {
                if (String.IsNullOrEmpty(providerList.ProviderID))
                {
                    providerID = string.Empty;
                }
                else
                {
                    providerID = providerList.ProviderID;
                }

            }
            catch
            {
                providerID = string.Empty;
            }
            try
            {
                if (String.IsNullOrEmpty(providerList.ProviderName))
                {
                    providerName = string.Empty;
                }
                else
                {
                    providerName = providerList.ProviderName;
                }
            }
            catch
            {
                providerName = string.Empty;
            }

            try
            {
                if (String.IsNullOrEmpty(providerList.Department))
                {
                    department = string.Empty;
                }
                else
                {
                    department = providerList.Department;
                }
            }
            catch
            {
                department = string.Empty;
            }

            using (MySqlConnection db = new MySqlConnection(Database.ReminderConnection))
            {
                try
                {
                    string query =
                        "update providers"
                        + " set providerID = @providerID"
                        + " , providerName = @providerName"
                        + " , department = @department"
                        + " where id = @ID";

                    int rowsAffectd = db.Execute(query, new
                    {
                        @providerID = providerID,
                        @providerName = providerName,
                        @department = department,
                        @ID = providerList.ID
                    }
                        );
                }
                catch (Exception er)
                {
                    Log.LogMessage(er.ToString());
                }
            }
        }
        public void DeleteProvider(ProviderList providerList)
        {
            using (MySqlConnection db = new MySqlConnection(Database.ReminderConnection))
            {
                try
                {
                    string query =
                        "delete from providers"
                        + " where id = @id";

                    int rowsAffectd = db.Execute(query, new
                    {
                        @id = providerList.ID
                    }
                        );
                }
                catch (Exception er)
                {
                    Log.LogMessage(er.ToString());
                }
            }
        }
 public void AddProvider(ProviderList providerList)
 {
     using (MySqlConnection db = new MySqlConnection(Database.ReminderConnection))
     {
         try
         {
             string query =
                 "insert into providers(providerID,providerName,department)"
                 + "values(@providerID,@providerName,@department)";
             int rowsAffectd = db.Execute(query, new
             {
                 @providerID = providerList.ProviderID,
                 @providerName = providerList.ProviderName,
                 @department = providerList.Department
             }
                 );
         }
         catch (Exception er)
         {
             Log.LogMessage(er.ToString());
         }
     }
 }