Last active
December 23, 2016 10:40
-
-
Save isdaviddong/e246b9829acbd9f6da5c8047ed43aa73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
using isRock.Framework; | |
using isRock.Framework.WebAPI; | |
namespace WebApplication15.BO | |
{ | |
public class Health : BusinessLogicBase | |
{ | |
/// <summary> | |
/// 計算BMI | |
/// </summary> | |
/// <param name="bodyInfo"></param> | |
/// <returns></returns> | |
public ExecuteCommandDefaultResult BMI(BodyInfo bodyInfo) | |
{ | |
float height = (bodyInfo.height) / 100; | |
var bmi = bodyInfo.weight / (height * height); | |
return new ExecuteCommandDefaultResult() { Data = bmi, isSuccess = true }; | |
} | |
} | |
/// <summary> | |
/// 個人身高體重 | |
/// </summary> | |
public class BodyInfo | |
{ | |
public float height { get; set; } | |
public float weight { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment