/// <summary>
 /// Function to insert values to Settings Table
 /// </summary>
 /// <param name="settingsinfo"></param>
 public void SettingsAdd(SettingsInfo settingsinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("SettingsAdd", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@settingsId", SqlDbType.Decimal);
         sprmparam.Value = settingsinfo.SettingsId;
         sprmparam = sccmd.Parameters.Add("@settingsName", SqlDbType.VarChar);
         sprmparam.Value = settingsinfo.SettingsName;
         sprmparam = sccmd.Parameters.Add("@status", SqlDbType.VarChar);
         sprmparam.Value = settingsinfo.Status;
         sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.VarChar);
         sprmparam.Value = settingsinfo.ExtraDate;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = settingsinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = settingsinfo.Extra2;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
 /// <summary>
 /// Function to Update values in Settings Table
 /// </summary>
 /// <param name="settingsinfo"></param>
 public void SettingsEdit(SettingsInfo settingsinfo)
 {
     try
     {
         spSettings.SettingsEdit(settingsinfo);
     }
     catch (Exception ex)
     {
         MessageBox.Show("ST12:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 /// <summary>
 /// Function to view  settings based on parameter
 /// </summary>
 /// <param name="strsettingsName"></param>
 /// <returns></returns>
 public SettingsInfo SettingsView(string strsettingsName)
 {
     SettingsInfo settingsinfo = new SettingsInfo();
       try
       {
       settingsinfo = spSettings.SettingsView(strsettingsName);
       }
       catch (Exception ex)
       {
       MessageBox.Show("ST5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
       }
       return settingsinfo;
 }
 /// <summary>
 /// Function to view  settings based on parameter
 /// </summary>
 /// <param name="strsettingsName"></param>
 /// <returns></returns>
 public SettingsInfo SettingsView(string strsettingsName)
 {
     SettingsInfo settingsinfo = new SettingsInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("SettingsView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@settingsName", SqlDbType.VarChar);
         sprmparam.Value = strsettingsName;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             settingsinfo.SettingsId = Convert.ToDecimal(sdrreader[0].ToString());
             settingsinfo.SettingsName = sdrreader[1].ToString();
             settingsinfo.Status = sdrreader[2].ToString();
             settingsinfo.ExtraDate = DateTime.Parse(sdrreader[3].ToString());
             settingsinfo.Extra1 = sdrreader[4].ToString();
             settingsinfo.Extra2 = sdrreader[5].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return settingsinfo;
 }