Esempio n. 1
0
        /// <summary>
        /// Mở cửa sổ thông báo
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="parent">The parent.</param>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/10/2015   created
        /// </Modified>
        public static void OpenFormInfo(MessageConfirm message, frmDieuHanhDienThoaiNEWCP_V4 parent)
        {
            frmInfo frmThongTin = new frmInfo();
            string  frmCaption  = string.Empty;

            if (MessageCodes.ContainsKey(message.MaMessage))
            {
                frmCaption = MessageCodes[message.MaMessage];
            }
            bool isButtonVisible = true;
            bool doUseTimer      = true;

            switch (message.MaMessage)
            {
            case MA_LENH_DADON:
                isButtonVisible = false;
                break;

            case MA_LENH_DAKETTHUC:
                doUseTimer = false;
                break;

            default:
                break;
            }
            frmThongTin.SetModel(message, frmCaption, parent, isButtonVisible, doUseTimer);
            frmThongTin.Show();
        }
Esempio n. 2
0
        /// <summary>
        /// Set giao diện cho form trước khi hiển thị lên màn hình
        /// </summary>
        /// <param name="model">The model.</param>
        /// <param name="lenhLaiXe">The lenh lai xe.</param>
        /// <param name="parent">The parent.</param>
        /// <param name="isButtonVisible">if set to <c>true</c> [is button visible].</param>
        /// <param name="doUseTimer">if set to <c>true</c> [do use timer].</param>
        /// <Modified>
        /// Name     Date         Comments
        /// LuanBH  8/11/2015   created
        /// </Modified>
        public void SetModel(MessageConfirm model, string lenhLaiXe, frmDieuHanhDienThoaiNEWCP_V4 parent, bool isButtonVisible, bool doUseTimer)
        {
            if (model == null)
            {
                this.Close();
                return;
            }
            ParentForm          = parent;
            txtDiaChiDon.Text   = model.DiaChiDonKhach;
            lblPrivateCode.Text = model.XeDon;
            grbForm.Text        = lenhLaiXe;
            Model = model;
            if (doUseTimer)
            {
                timer1.Start();
            }

            if (model.MaMessage == EnVangManagement.MA_LENH_XINDIEMDO)
            {
                iluVungDH.Bind();
                pnlVungDH.Visible = true;
                pnlDiaChi.Visible = false;
                iluVungDH.SetValue(model.MessageContent);
            }

            if (!isButtonVisible)
            {
                btnYes.Visible = false;
                btnNo.Visible  = false;
                this.Height    = this.Height - btnYes.Height;
            }
        }