public void Delete(long Id)
        {
            Broken item = new Broken();
            item.Id = Id;

            dao.Delete(item);
        }
Beispiel #2
0
        public void Apply_NotAnObject_Test()
        {
            var entity = Mock.Of <IEntity>();
            var Broken = new Broken();

            Broken.Apply(entity);
            Assert.IsTrue(true); // If we made it here with exception then the test passed
        }
Beispiel #3
0
        /// <summary>
        /// Returns true if InventoryOrderStatistic instances are equal
        /// </summary>
        /// <param name="other">Instance of InventoryOrderStatistic to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(InventoryOrderStatistic other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                     ) &&
                 (
                     Total == other.Total ||
                     Total != null &&
                     Total.Equals(other.Total)
                 ) &&
                 (
                     Default == other.Default ||
                     Default != null &&
                     Default.Equals(other.Default)
                 ) &&
                 (
                     Missed == other.Missed ||
                     Missed != null &&
                     Missed.Equals(other.Missed)
                 ) &&
                 (
                     Broken == other.Broken ||
                     Broken != null &&
                     Broken.Equals(other.Broken)
                 ) &&
                 (
                     Active == other.Active ||
                     Active != null &&
                     Active.Equals(other.Active)
                 ) &&
                 (
                     Remaining == other.Remaining ||
                     Remaining != null &&
                     Remaining.Equals(other.Remaining)
                 ) &&
                 (
                     Research == other.Research ||
                     Research != null &&
                     Research.Equals(other.Research)
                 ) &&
                 (
                     Transferred == other.Transferred ||
                     Transferred != null &&
                     Transferred.Equals(other.Transferred)
                 ));
        }
Beispiel #4
0
        public void Apply_Character_WithExistingBrokenCondition_Test()
        {
            var obj = CreateMockObject();

            obj.Conditions.Add(new Broken());
            var broken = new Broken();

            broken.Apply(obj);
        }
Beispiel #5
0
 public override void RecieveMoneyForInsurance(TimeSpan time)
 {
     lock (lockObj)
     {
         Thread.Sleep(time);
         Broken?.Invoke(this);
         StopWork();
     }
 }
Beispiel #6
0
	public static int test_0_exception_in_cctor () {
		try {
			Broken.DoSomething ();
		}
		catch (TypeInitializationException) {
			// This will only happen once even if --regression is used
		}
		return 0;
	}
Beispiel #7
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Total != null)
         {
             hashCode = hashCode * 59 + Total.GetHashCode();
         }
         if (Default != null)
         {
             hashCode = hashCode * 59 + Default.GetHashCode();
         }
         if (Missed != null)
         {
             hashCode = hashCode * 59 + Missed.GetHashCode();
         }
         if (Broken != null)
         {
             hashCode = hashCode * 59 + Broken.GetHashCode();
         }
         if (Active != null)
         {
             hashCode = hashCode * 59 + Active.GetHashCode();
         }
         if (Remaining != null)
         {
             hashCode = hashCode * 59 + Remaining.GetHashCode();
         }
         if (Research != null)
         {
             hashCode = hashCode * 59 + Research.GetHashCode();
         }
         if (Transferred != null)
         {
             hashCode = hashCode * 59 + Transferred.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #8
0
    public void TakePopulationDamage(int damage)
    {
        Debug.Log("TakingDamage");
        population -= damage;
        CivWorld.SetActive(false);
        ThrivingWorld.SetActive(false);
        Fertile.SetActive(false);
        Broken.SetActive(false);
        Bad.SetActive(false);
        Apocalyptic.SetActive(false);

        if (population > 2000)
        {
            CivWorld.SetActive(true);
        }
        if (population > 1500)
        {
            ThrivingWorld.SetActive(true);
        }
        if (population > 1200)
        {
            Fertile.SetActive(true);
        }
        if (population > 900)
        {
            Broken.SetActive(true);
        }
        if (population > 600)
        {
            Bad.SetActive(true);
        }
        if (population > 0)
        {
            Apocalyptic.SetActive(true);
        }

        if (population < 0)
        {
            GameOver();
        }
    }
Beispiel #9
0
 public void StartWork()
 {
     IsWorking = true;
     while (IsWorking)
     {
         Y -= 10;
         if (Y <= 100)
         {
             Succeed?.Invoke(this);
             SignalizeAboutSuccess(TimeSpan.FromSeconds(3));
             return;
         }
         if (_rnd.NextDouble() <= _brokeChance && !IsBroken)
         {
             IsBroken = true;
             Broken?.Invoke(this);
             return;
         }
         Thread.Sleep(200);
     }
 }
Beispiel #10
0
 void OnBroken(Exception last, TimeSpan next)
 {
     Broken?.Invoke(this, new BrokenArgs {
         Last = last, Wait = next
     });
 }
Beispiel #11
0
 private void OnBroken()
 {
     Broken?.Invoke(this, EventArgs.Empty);
 }
 public void AddBrokenTofoot(Broken broken)
 {
     footBroken = broken;
     brokenCode = (broken != null) ? broken.Brokencode : "";
     ViewState["Exchange_BrokenCode"] = brokenCode;
 }
 private void ClearFootState()
 {
     footBroken = null; if (ViewState["Exchange_BrokenCode"] != null) ViewState.Remove("Exchange_BrokenCode");
     footWarr = null; if (ViewState["Exchange_SpareNumber"] != null) ViewState.Remove("Exchange_SpareNumber");
     quantity = "1";
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        errors.Clear();

        if (!IsPostBack)
        {
            if (sender != null) InitForm(); // manual call to pageLoad
            if (gvexSpareList.DataSourceTable == null)
                gvexSpareList.DataSourceTable = AddExchange.SpareListOnServiceSchema;

            gvexSpareList.EmptyTableRowText = Message.WarrantyContent_EmptySpareList;

            if (RawSpareList != null) gvexSpareList.DataSourceTable = RawSpareList;
        }
        if (ViewState["Exchange_BrokenCode"] != null)
        {
            brokenCode = ViewState["Exchange_BrokenCode"].ToString();
            footBroken = WarrantyContent.GetBroken(brokenCode);
        }
        if (ViewState["Exchange_SpareNumber"] != null)
        {
            spareNumber = ViewState["Exchange_SpareNumber"].ToString();
            footWarr = WarrantyContent.GetWarrantyCondition(spareNumber);
        }

        // save new spare quantity
        if (gvexSpareList.EditIndex < 0)
        {
            TextBox tb = (TextBox)WebTools.FindControlById("txtexQuantity", gvexSpareList);
            if (tb != null) quantity = tb.Text;
        }
    }
Beispiel #15
0
    Broken script;    //スプリクトを入れる変数名

    // Use this for initialization
    void Start()
    {
        enemy  = GameObject.Find("Enemy"); //
        script = enemy.GetComponent <Broken>();
    }
 protected virtual void OnBroken()
 {
     Broken?.Invoke(this, EventArgs.Empty);
 }
 public bool Insert(string BrokenCode, string Brokenname, string editby)
 {
     dao.SetCriteria(new ICriterion[] { Expression.Eq("Brokencode", BrokenCode.Trim()) });
     List<Broken> lst = dao.GetAll();
     if (lst.Count > 0) return false;
     try
     {
         Broken item = new Broken(Brokenname.Trim(), DateTime.Now, editby.Trim(), BrokenCode.Trim());
         dao.Save(item);
         return true;
     }
     catch { return false; }
 }
Beispiel #18
0
 private void OnBreak()
 {
     status = ServerState.Failure.ToString();
     Broken?.Invoke(this, EventArgs.Empty);
 }