Пример #1
0
        private void TinhVanHanh(LOAI_CONG_THUC LoaiCongThuc)
        {
            switch (LoaiCongThuc)
            {

                case LOAI_CONG_THUC.M3_TAN:
                    spbKm.Enabled = false;
                    spbGio.Enabled = false;
                    spbVanHanh.Value = spbm3.Value * spbTan.Value;
                    txtDonVi.Text = "tan.m3";
                    break;
                case LOAI_CONG_THUC.GIO:
                    spbTan.Enabled = false;
                    spbKm.Enabled = false;
                    spbm3.Enabled = false;
                    spbVanHanh.Value = spbGio.Value;
                    txtDonVi.Text = "h";
                    break;
                case LOAI_CONG_THUC.KM_TAN:
                    spbGio.Enabled = false;
                    spbm3.Enabled = false;
                    spbVanHanh.Value = spbKm.Value * spbTan.Value;
                    txtDonVi.Text = "tan.km";
                    break;
                case LOAI_CONG_THUC.M3:
                    spbGio.Enabled = false;
                    spbTan.Enabled = false;
                    spbKm.Enabled = false;
                    spbVanHanh.Value = spbm3.Value;
                    txtDonVi.Text = "m3";
                    break;
                case LOAI_CONG_THUC.TAN:
                    spbm3.Enabled = false;
                    spbGio.Enabled = false;
                    spbKm.Enabled = false;
                    spbVanHanh.Value = spbTan.Value;
                    txtDonVi.Text = "tan";
                    break;
                default:
                    break;
            }
        }
Пример #2
0
        private void EnableControlForVanHanh(LOAI_CONG_THUC loaiCongThuc)
        {
            switch (loaiCongThuc)
            {

                case LOAI_CONG_THUC.M3:
                    spbm3.Enabled = true;
                    spbGio.Enabled = false;
                    spbKm.Enabled = false;
                    spbTan.Enabled = false;
                    spbVanHanh.Enabled = false;
                    break;
                case LOAI_CONG_THUC.GIO:
                    spbm3.Enabled = false;
                    spbGio.Enabled = true;
                    spbKm.Enabled = false;
                    spbTan.Enabled = false;
                    spbVanHanh.Enabled = false;
                    break;
                case LOAI_CONG_THUC.KM_TAN:
                    spbm3.Enabled = false;
                    spbGio.Enabled = false;
                    spbKm.Enabled = true;
                    spbTan.Enabled = true;
                    spbVanHanh.Enabled = false;
                    break;
                case LOAI_CONG_THUC.M3_TAN:
                    spbm3.Enabled = true;
                    spbGio.Enabled = false;
                    spbKm.Enabled = false;
                    spbTan.Enabled = true;
                    spbVanHanh.Enabled = false;
                    break;
                case LOAI_CONG_THUC.TAN:
                    spbm3.Enabled = false;
                    spbGio.Enabled = false;
                    spbKm.Enabled = false;
                    spbTan.Enabled = true;
                    spbVanHanh.Enabled = false;
                    break;

                default:
                    spbm3.Enabled = false;
                    spbGio.Enabled = false;
                    spbKm.Enabled = false;
                    spbTan.Enabled = true;
                    spbVanHanh.Enabled = false;
                    break;
            }
        }