Exemple #1
0
        public TassaDiSoggiorno(connectoToMySql mCon, string pren, string cam, string arr, string par, Bel3 b3, bool fpan)
        {
            frompan     = fpan;
            bel3        = b3;
            mConnection = mCon;
            if (mConnection != null)
            {
                if (mConnection.cnMySQL.State != ConnectionState.Closed)
                {
                    mConnection.cnMySQL.Close();
                }

                if (mConnection.cnMySQL.State != ConnectionState.Open)
                {
                    mConnection.cnMySQL.Open();
                }

                mConnection.cmdMySQL = new MySqlCommand("select tariffa from tariffeextra where nome='Tassa di Soggiorno'", mConnection.cnMySQL);

                //
                // 4. Use the connection
                //

                // get query results
                mConnection.reader = mConnection.cmdMySQL.ExecuteReader();

                // print the CustomerID of each record
                while (mConnection.reader.Read())
                {
                    string thisrow = "";
                    thisrow = mConnection.reader.GetValue(0).ToString();
                    if (thisrow != "")
                    {
                        prezzo = Convert.ToSingle(thisrow);
                    }
                }

                if (mConnection.cnMySQL.State != ConnectionState.Closed)
                {
                    mConnection.cnMySQL.Close();
                }
            }
            npren         = pren;
            currentcamera = cam;
            DateTime partenza = DateTime.Parse(par);
            DateTime arrivo   = DateTime.Parse(arr);
            TimeSpan daysc    = partenza - arrivo;

            days = (daysc.Days);
            if (days > 4)
            {
                days = 4;
            }
            if (days < 1)
            {
                days = 1;
            }
            InitializeComponent();
        }
Exemple #2
0
 public Datepicker(MySqlConnection Connection, List <CheckIn> checkins, Bel3 bel3)
 {
     connection = Connection;
     InitializeComponent();
     dateTimePicker1.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
     CheckIns = checkins;
     b3       = bel3;
 }
Exemple #3
0
 public Datepicker(MySqlConnection Connection, int idpren, string camera, Bel3 bel3)
 {
     connection = Connection;
     InitializeComponent();
     dateTimePicker1.Value = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day);
     CheckIns = new List <CheckIn>();
     CheckIns.Add(new CheckIn(idpren, camera));
     b3 = bel3;
 }