public override BodyComposition BuildWithoutModelValidation()
 {
     return(new BodyComposition
     {
         Height = Height.Build(_heightInches),
         Hips = Hips.Build(_hipsInches),
         Waist = Waist.Build(_waistInches),
         Weight = Weight.Build(_weightPounds)
     });
 }
 public override BodyCompositionExpanded BuildWithoutModelValidation()
 {
     return(new BodyCompositionExpanded
     {
         Height = Height.Build(_heightInches),
         Waist = Waist.Build(_waistInches),
         Hips = Hips.Build(_hipsInches),
         Weight = Weight.Build(_weightPounds),
         VisceralFat = _visceralFatCm2,
         PercentBodyFat = _percentBodyFat
     });
 }
Пример #3
0
        private void dataGrid_Side_CellValueChanged(object sender, DataGridViewCellEventArgs e)
        {
            //修改单元格的值 tab3
            if (e.RowIndex == -1 || e.ColumnIndex == -1)
            {
                return;
            }
            int   b     = ((e.RowIndex * 50) + StartIndex);
            int   hw    = int.Parse(dataGrid_Side.Columns[e.ColumnIndex].Name);
            Waist param = _waistList.Find(x => x.Hw == hw && x.B == b);

            if (param != null)
            {
                param.Value = dataGrid_Side.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString();
            }
        }
Пример #4
0
 private void Number_reg_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
 {
     try
     {
         if (!(Regex.IsMatch(Height.Text, @"^\d*$")))
         {
             Height.Clear();
             throw new Exception("Error!!! Неправильные символы");
         }
         else if (!(Regex.IsMatch(Weight.Text, @"^\d*$")))
         {
             Weight.Clear();
             throw new Exception("Error!!! Неправильные символы");
         }
         else if (!(Regex.IsMatch(Arms.Text, @"^\d*$")))
         {
             Arms.Clear();
             throw new Exception("Error!!! Неправильные символы");
         }
         else if (!(Regex.IsMatch(Waist.Text, @"^\d*$")))
         {
             Waist.Clear();
             throw new Exception("Error!!! Неправильные символы");
         }
         else if (!(Regex.IsMatch(Chest.Text, @"^\d*$")))
         {
             Chest.Clear();
             throw new Exception("Error!!! Неправильные символы");
         }
         else if (!(Regex.IsMatch(Leg.Text, @"^\d*$")))
         {
             Leg.Clear();
             throw new Exception("Error!!! Неправильные символы");
         }
         else if (!(Regex.IsMatch(Hip.Text, @"^\d*$")))
         {
             Hip.Clear();
             throw new Exception("Error!!! Неправильные символы");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Пример #5
0
        public Survivor()
        {
            Survival      = 1;
            SurvivalLimit = 1;
            Movement      = 0;
            Strength      = 0;
            Accuracy      = 0;
            Evasion       = 0;
            Luck          = 0;
            Speed         = 0;
            Understanding = 0;
            Courage       = 0;

            Brain = new Brain();
            Head  = new Head();
            Body  = new Body();
            Arm   = new Arm();
            Waist = new Waist();
            Legs  = new Legs();

            EquippedWeapon = new FoundingStone();
        }
Пример #6
0
 public virtual JsonResult Edit(Waist model)
 {
     try
     {
         Waist obj = DataProvider.Entities.Waists.Find(model.Id);
         if (obj.Id > 0)
         {
             obj.OrderNumber = model.OrderNumber;
             obj.WaistName   = model.WaistName;
             DataProvider.Entities.SaveChanges();
             QuanTri.SaveLog("Chỉnh sửa waist ", "Quản lý waist", (int)CommonAdmin.ConstantCommon.Action.Edit);
             //return Json(new JsonPostBack("Cập nhật thành công", true), JsonRequestBehavior.AllowGet);
             return(Json(new JsonResponse
             {
                 Message = ResponseMessage.SuccessUpdate,
                 Success = true
             }, JsonRequestBehavior.AllowGet));
         }
         else
         {
             //return Json(new JsonPostBack("Xảy ra lỗi trong quá trình xử lý", false), JsonRequestBehavior.AllowGet);
             return(Json(new JsonResponse
             {
                 Message = ResponseMessage.Error,
                 Success = false
             }, JsonRequestBehavior.AllowGet));
         }
     }
     catch (Exception)
     {
         //return Json(new JsonPostBack("Xảy ra lỗi trong quá trình xử lý", false), JsonRequestBehavior.AllowGet);
         return(Json(new JsonResponse
         {
             Message = ResponseMessage.Error,
             Success = false
         }, JsonRequestBehavior.AllowGet));
     }
 }
Пример #7
0
 public JsonResult Add(Waist model)
 {
     try
     {
         DataProvider.Entities.Waists.Add(model);
         DataProvider.Entities.SaveChanges();
         QuanTri.SaveLog("Thêm mới waist ", "Quản lý waist", (int)CommonAdmin.ConstantCommon.Action.Add);
         //return Json(new JsonPostBack("Thêm mới thành công", true), JsonRequestBehavior.AllowGet);
         return(Json(new JsonResponse
         {
             Message = ResponseMessage.SuccessCreate,
             Success = true
         }, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         //return Json(new JsonPostBack("Xảy ra lỗi trong quá trình xử lý", false), JsonRequestBehavior.AllowGet);
         return(Json(new JsonResponse
         {
             Message = ResponseMessage.Error,
             Success = false
         }, JsonRequestBehavior.AllowGet));
     }
 }
Пример #8
0
 private BodyComposition(double heightInches, double waistInches, double hipsInches, double weightPounds)
     : this(Height.Build(heightInches), Waist.Build(waistInches), Hips.Build(hipsInches),
            Weight.Build(weightPounds))
 {
 }
Пример #9
0
 public void TestWaistPositive()
 {
     Waist waist = new Waist(-1);
 }
Пример #10
0
 public void TestWaistNotZero()
 {
     Waist waist = new Waist(0);
 }
Пример #11
0
        public void TestWaistExists()
        {
            Waist waist = new Waist(25);

            Assert.AreEqual(25, waist.Circ);
        }