public void AddMeasurements(MeasureModel me) { var strUserId = user.UserId; var strId = Guid.NewGuid().ToString(); SqlCommand cmd = new SqlCommand(@"insert into measurement(id, neck, shoulder, arm, forearm, wrist, chest, waist, abdomen, hips, thigh, knee, calf, bodyweight, userid) values(@id, @neck, @shoulder, @arm, @forearm, @wrist, @chest, @waist, @abdomen, @hips, @thigh, @knee, @calf, @weight, @userid)"); cmd.Parameters.AddWithValue("@id", strId); cmd.Parameters.AddWithValue("@neck", cm.AddParameter(me.Neck)); cmd.Parameters.AddWithValue("@shoulder", cm.AddParameter(me.Shoulder)); cmd.Parameters.AddWithValue("@arm", cm.AddParameter(me.Arm)); cmd.Parameters.AddWithValue("@forearm", cm.AddParameter(me.Forearm)); cmd.Parameters.AddWithValue("@wrist", cm.AddParameter(me.Wrist)); cmd.Parameters.AddWithValue("@chest", cm.AddParameter(me.Chest)); cmd.Parameters.AddWithValue("@waist", cm.AddParameter(me.Waist)); cmd.Parameters.AddWithValue("@abdomen", cm.AddParameter(me.Abdomen)); cmd.Parameters.AddWithValue("@hips", cm.AddParameter(me.Hips)); cmd.Parameters.AddWithValue("@thigh", cm.AddParameter(me.Thigh)); cmd.Parameters.AddWithValue("@knee", cm.AddParameter(me.Knee)); cmd.Parameters.AddWithValue("@calf", cm.AddParameter(me.Calf)); cmd.Parameters.AddWithValue("@weight", cm.AddParameter(me.BodyWeight)); cmd.Parameters.AddWithValue("@userid", strUserId); db.ExecNonQuery(cmd); cmd = new SqlCommand(@"insert into bodyweight(userid, bodyweight, measurementid) values(@userid, @weight, @measurementid)"); cmd.Parameters.AddWithValue("@userid", strUserId); cmd.Parameters.AddWithValue("@weight", cm.AddParameter(me.BodyWeight)); cmd.Parameters.AddWithValue("@measurementid", strId); db.ExecNonQuery(cmd); }