示例#1
0
        protected void btnSaveMeasurement_Click(object sender, EventArgs e)
        {
            try
            {
                if (MeasurementMode == "Insert")
                {
                    MeasurementMaster objMesurement = new MeasurementMaster();

                    objMesurement.memberId = MemberId;
                    objMesurement.WEIGHT   = txtMWeight.Text;
                    objMesurement.HEIGHT   = Convert.ToDecimal(txtMHeight.Text);
                    objMesurement.FAT      = Convert.ToDecimal(txtFat.Text);
                    objMesurement.BMI      = Convert.ToDecimal(txtBMi.Text);
                    objMesurement.BMR      = txtBMR.Text;
                    objMesurement.NECK     = txtNeck.Text;
                    objMesurement.SHOULDER = txtShoulder.Text;
                    objMesurement.CHEST    = txtChest.Text;
                    objMesurement.ARMS     = txtArms.Text;
                    objMesurement.WAIST    = txtWaist.Text;
                    objMesurement.HIPS     = txtHips.Text;
                    objMesurement.THIGH    = txtThigh.Text;
                    objMesurement.CALF     = txtCalf.Text;

                    objMesurement = new DesclaimerController().InsertMeasurement(objMesurement);
                }
                else
                {
                    MeasurementMaster objMesurement = DesclaimerController.GetMeasurementById(MeasurementId);

                    objMesurement.memberId = MemberId;
                    objMesurement.WEIGHT   = txtMWeight.Text;
                    objMesurement.HEIGHT   = Convert.ToDecimal(txtMHeight.Text);
                    objMesurement.FAT      = Convert.ToDecimal(txtFat.Text);
                    objMesurement.BMI      = Convert.ToDecimal(txtBMi.Text);
                    objMesurement.BMR      = txtBMR.Text;
                    objMesurement.NECK     = txtNeck.Text;
                    objMesurement.SHOULDER = txtShoulder.Text;
                    objMesurement.CHEST    = txtChest.Text;
                    objMesurement.ARMS     = txtArms.Text;
                    objMesurement.WAIST    = txtWaist.Text;
                    objMesurement.HIPS     = txtHips.Text;
                    objMesurement.THIGH    = txtThigh.Text;
                    objMesurement.CALF     = txtCalf.Text;

                    objMesurement = new DesclaimerController().UpdateMeasurement(objMesurement);
                }
                ClearMeasurementValues();
                BindMeasurement();
                MeasurementPanelVisibility(true, false);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
        private void BindMeasurementValues()
        {
            MeasurementMaster objMeasur = DesclaimerController.GetMeasurementById(MeasurementId);

            txtMWeight.Text  = objMeasur.WEIGHT;
            txtMHeight.Text  = Convert.ToString(objMeasur.HEIGHT);
            txtFat.Text      = Convert.ToString(objMeasur.FAT);
            txtBMi.Text      = Convert.ToString(objMeasur.BMI);
            txtBMR.Text      = objMeasur.BMR;
            txtNeck.Text     = objMeasur.NECK;
            txtShoulder.Text = objMeasur.SHOULDER;
            txtChest.Text    = objMeasur.CHEST;
            txtArms.Text     = objMeasur.ARMS;
            txtWaist.Text    = objMeasur.WAIST;
            txtHips.Text     = objMeasur.HIPS;
            txtThigh.Text    = objMeasur.THIGH;
            txtCalf.Text     = objMeasur.CALF;

            new DesclaimerController().UpdateMeasurement(objMeasur);
        }