Skip to content

Instantly share code, notes, and snippets.

@isdaviddong
Last active December 23, 2016 10:40
Show Gist options
  • Save isdaviddong/e246b9829acbd9f6da5c8047ed43aa73 to your computer and use it in GitHub Desktop.
Save isdaviddong/e246b9829acbd9f6da5c8047ed43aa73 to your computer and use it in GitHub Desktop.
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