Ejemplo n.º 1
0
Archivo: Roller.cs Proyecto: jhogan/qed
		private  void _roll() {
			try{
				if (UI.UI.ClientVerMatchesDBVer()){
					this.IsRolling = true;
					this._dateTimeStarted = DateTime.Now;
					_log = new RolloutLog();
					Report("-".PadLeft(87, '-'));
					Report("Begin rollout at " + DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString());
					Report("Roller class: " + this.GetType().Name + "\r\nRollType = " + this.RollType.ToString());
					Report("-".PadLeft(87, '-'));
					this.BK();
					this.GET();
					this.PREP();
					this.PUT();
					this.IsRolling = false;
					Report("---Rollout has finished---");
					OnCompleted(this, new ReportEventArgs("Rollout completed successfully"));
				}else{
					throw new Exception("Client version is out of synch with DB version. Please update QED client before performing this roll.");
				}
			}
			catch(Exception ex){
				this.IsRolling = false;
				Report(ex.Message + "\r\n" + ex.StackTrace);
				throw new Exception(ex.Message, ex);
			}
		 }
Ejemplo n.º 2
0
 public RolloutLog Add(RolloutLog obj)
 {
     obj.BusinessCollection = this;
     List.Add(obj); return obj;
 }
Ejemplo n.º 3
0
 public bool Contains(RolloutLog obj)
 {
     foreach(RolloutLog child in List) {
         if (obj.Equals(child)){
             return true;
         }
     }
     return false;
 }
Ejemplo n.º 4
0
 public RolloutLogs(string rollerClass, string rollType)
 {
     RolloutLog log;
     using (MySqlConnection conn = Connections.Inst.item("QED_DB").MySqlConnection){
         conn.Open();
         MySqlCommand cmd = conn.CreateCommand();
         cmd.CommandText = "SELECT " + AllColumnsExceptText + " FROM " + _table + " WHERE rollClass = @RollClass and rollType = @RollType ORDER BY ts, rollClass, rollType";
         cmd.Parameters.Add("@RollClass", rollerClass);
         cmd.Parameters.Add("@RollType", rollType);
         using(MySqlDataReader dr = cmd.ExecuteReader()){
             while(dr.Read()){
                 log = new RolloutLog(dr);
                 this.Add(log);
             }
         }
     }
 }