/// <summary>
        /// Does the pasre.
        /// </summary>
        /// <Modified>
        /// Name     Date         Comments
        /// HauNV  26/08/2015   created
        /// </Modified>
        private void DoPasre()
        {
            if (modelCurrent == null)
            {
                modelCurrent = new MobileOperationCommands();
            }
            modelCurrent.CommandName = txtTenLenh.Text;
            modelCurrent.FK_MobileOperationStepWorkflowID = lsBox_StepWorkflow.SelectedValue.To <int>();
            modelCurrent.FK_CompanyID    = ThongTinCauHinh.CompanyID;
            modelCurrent.ForeColor       = ((Color)lueForeColor.EditValue).ToArgb();
            modelCurrent.BackgroundColor = ((Color)lueBackgroundColor.EditValue).ToArgb();  //lueBackgroundColor.EditValue.To<int>();
            modelCurrent.PMDH_CallStatus = lueTrangThaiCG.EditValue.To <int>();
            modelCurrent.PMDH_CallType   = lueKieuCuocGoi.EditValue.To <int>();
            modelCurrent.PMDH_Status     = lueTrangThaiLenh.EditValue.To <int>();
            modelCurrent.Priority        = inputPriority.EditValue.To <int>();
            modelCurrent.PMDH_Shortcuts  = luePhimTat.EditValue.To <int>();
            modelCurrent.HasAlarmVoice   = ckbAmThanh.Checked;

            if (modelCurrent.HasAlarmVoice)
            {
                modelCurrent.VoiceAlarm = lueAudio.EditValue.To <string>();
            }
            else
            {
                modelCurrent.VoiceAlarm = string.Empty;
            }
            modelCurrent.HasLimitedTime = ckbGioiHanThoiGian.Checked;
            if (modelCurrent.HasLimitedTime)
            {
                modelCurrent.FromMinutes = txtTu.EditValue.To <int>();
                modelCurrent.ToMinutes   = txtDen.EditValue.To <int>();
            }
            else
            {
                modelCurrent.FromMinutes = 0;
                modelCurrent.ToMinutes   = 0;
            }
            modelCurrent.IsShow = ckbHienThiIcon.Checked;
            if (modelCurrent.IsShow)
            {
                modelCurrent.Icon = lueIcon.EditValue.To <string>();
            }
            else
            {
                modelCurrent.Icon = string.Empty;
            }
            modelCurrent.SpeechSynthesizerVoice = lueAudioVe.EditValue.To <string>();
            modelCurrent.PMDH_RequireVehicle    = ckbCoXeNhan.Checked;
            if (lueColor.EditValue != null)
            {
                modelCurrent.PMDH_ParentColor = lueColor.EditValue.As <Color>().Name;
            }
            else
            {
                modelCurrent.PMDH_ParentColor = string.Empty;
            }
            modelCurrent.PMDH_ParentCommand = cmb_CommandParrent.EditValue.To <string>();
        }
 private void btn_Command_Add_Click(object sender, System.EventArgs e)
 {
     if (DoValidate())
     {
         modelCurrent = null;
         DoPasre();
         modelCurrent.Save();
         btn_Command_Refresh.PerformClick();
         SetMessge("Thêm dữ liệu thành công");
     }
 }
 private void btn_Command_Delete_Click(object sender, System.EventArgs e)
 {
     if (modelCurrent != null)
     {
         if (new MessageBox.MessageBoxBA().Show("Bạn có muốn xóa lệnh này không?", "Thông báo", MessageBox.MessageBoxButtonsBA.YesNo).ToLower() == "YES".ToLower())
         {
             modelCurrent.DeleteById(modelCurrent.PK_CommandID);
             btn_Command_Refresh.PerformClick();
             modelCurrent = null;
         }
     }
     else
     {
         new MessageBox.MessageBoxBA().Show("Bạn chưa chọn lệnh.");
     }
 }
 private void lsBox_StepWorkflow_SelectedValueChanged(object sender, System.EventArgs e)
 {
     if (lsBox_StepWorkflow.SelectedValue != null)
     {
         int id = lsBox_StepWorkflow.SelectedValue.To <int>();
         grdCommand.DataSource = MobileOperationCommands.Inst.GetListByIdStepWorkflow(id);
         //inputCheckedComboBox_MobileOperationCommand1.StepWorkflowId = id;
         cmb_CommandParrent.Bind();
     }
     else
     {
         grdCommand.DataSource = null;
     }
     DoClear();
     modelCurrent = null;
 }
 private void grvCommand_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
 {
     modelCurrent = grvCommand.GetFocusedRow <MobileOperationCommands>();
     DoFill();
 }
 private void grvCommand_SelectionChanged(object sender, DevExpress.Data.SelectionChangedEventArgs e)
 {
     modelCurrent = grvCommand.GetFocusedRow <MobileOperationCommands>();
     DoFill();
 }
 private void grvCommand_FocusedRowChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowChangedEventArgs e)
 {
     modelCurrent = grvCommand.GetFocusedRow <MobileOperationCommands>();
     DoFill();
 }