コード例 #1
0
        void try2StopQMS()
        {
            try
            {
                if (_QMSScreen != null)
                {

                    new Update(KcbQm.Schema)
                  .Set(KcbQm.Columns.TrangThai).EqualTo(0)
                  .Set(KcbQm.Columns.MaQuay).EqualTo(string.Empty)
                  .Where(KcbQm.Columns.TrangThai).IsEqualTo(1)
                  .And(KcbQm.Columns.MaQuay).IsEqualTo(PropertyLib._HISQMSProperties.MaQuay)
                  .And(KcbQm.Columns.MaKhoakcb).IsEqualTo(globalVariables.MA_KHOA_THIEN)
                  .AndExpression(KcbQm.Columns.MaDoituongKcb).IsEqualTo("ALL").Or(KcbQm.Columns.MaDoituongKcb).IsEqualTo(PropertyLib._HISQMSProperties.MaDoituongKCB).CloseExpression()
                    .And(KcbQm.Columns.LoaiQms).IsEqualTo(chkUuTien.Checked ? 1 : 0)
                  .Execute();
                    if (_QMSScreen != null && (!isQMSActive(_QMSScreen.Name)))
                    {
                        _QMSScreen.Close();
                        _QMSScreen.Dispose();
                        _QMSScreen = null;
                    }
                }
            }
            catch
            {
            }
        }
コード例 #2
0
 private void frm_KCB_DANGKY_FormClosing(object sender, FormClosingEventArgs e)
 {
     try
     {
         Utility.FreeLockObject(m_strMaluotkham);
         //Trả lại mã lượt khám nếu chưa được dùng đến
         new Update(KcbDmucLuotkham.Schema)
                .Set(KcbDmucLuotkham.Columns.TrangThai).EqualTo(0)
                .Set(KcbDmucLuotkham.Columns.UsedBy).EqualTo(DBNull.Value)
                .Set(KcbDmucLuotkham.Columns.StartTime).EqualTo(DBNull.Value)
                .Set(KcbDmucLuotkham.Columns.EndTime).EqualTo(null)
                .Where(KcbDmucLuotkham.Columns.MaLuotkham).IsEqualTo(Utility.Int32Dbnull( m_strMaluotkham,"-1"))
                .And(KcbDmucLuotkham.Columns.TrangThai).IsEqualTo(1)
                .And(KcbDmucLuotkham.Columns.UsedBy).IsEqualTo(globalVariables.UserName)
                .And(KcbDmucLuotkham.Columns.Nam).IsEqualTo(globalVariables.SysDate.Year).Execute();
                ;
         if (PropertyLib._HISQMSProperties.IsQMS)
         {
             new Update(KcbQm.Schema)
                 .Set(KcbQm.Columns.TrangThai).EqualTo(0)
                 .Set(KcbQm.Columns.MaQuay).EqualTo(string.Empty)
                 .Where(KcbQm.Columns.TrangThai).IsEqualTo(1)
                 .And(KcbQm.Columns.MaQuay).IsEqualTo(PropertyLib._HISQMSProperties.MaQuay)
                 .AndExpression(KcbQm.Columns.MaDoituongKcb).IsEqualTo("ALL").Or(KcbQm.Columns.MaDoituongKcb).IsEqualTo(PropertyLib._HISQMSProperties.MaDoituongKCB).CloseExpression()
             .And(KcbQm.Columns.LoaiQms).IsEqualTo(chkUuTien.Checked ? 1 : 0)
                 .And(KcbQm.Columns.MaKhoakcb).IsEqualTo(globalVariables.MA_KHOA_THIEN)
                 .Execute();
             if (_QMSScreen != null && (!isQMSActive(_QMSScreen.Name)))
             {
                 _QMSScreen.Close();
                 _QMSScreen.Dispose();
                 _QMSScreen = null;
             }
         }
     }
     catch (Exception exception)
     {
     }
 }
コード例 #3
0
        private void ShowQMSOnScreen2()
        {
            try
            {
                Screen[] sc;
                sc = Screen.AllScreens;
                IEnumerable<Screen> query = from mh in Screen.AllScreens
                                            select mh;
                //get all the screen width and heights

                if (PropertyLib._HISQMSProperties.TestMode || query.Count() >= 2)
                {
                    _QMSScreen = new frm_ScreenSoKham();
                    if (!isQMSActive(_QMSScreen.Name))
                    {
                        if (PropertyLib._HISQMSProperties.TestMode)
                            _QMSScreen.FormBorderStyle = FormBorderStyle.Sizable;
                        else
                            _QMSScreen.FormBorderStyle = FormBorderStyle.None;
                        if (query.Count() >= 2)
                        {
                            _QMSScreen.Left = sc[1].Bounds.Width;
                            _QMSScreen.Top = sc[1].Bounds.Height;
                            _QMSScreen.StartPosition = FormStartPosition.CenterScreen;
                            _QMSScreen.Location = sc[1].Bounds.Location;
                            var p = new Point(sc[1].Bounds.Location.X, sc[1].Bounds.Location.Y);
                            _QMSScreen.Location = p;
                        }
                        else
                        {
                            _QMSScreen.Left = 0;
                            _QMSScreen.Top = 0;
                            _QMSScreen.StartPosition = FormStartPosition.Manual;
                        }
                        if (!PropertyLib._HISQMSProperties.TestMode)
                            _QMSScreen.WindowState = FormWindowState.Maximized;
                        else
                            _QMSScreen.WindowState = FormWindowState.Normal;
                        _QMSScreen.Show();
                        //b_HasScreenmonitor = true;
                        txtSoKham_TextChanged(txtSoKham, new EventArgs());
                    }
                }
            }
            catch (Exception)
            {
            }
        }
コード例 #4
0
 /// <summary>
 /// hàm thực hiện việc stop
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void cmdStop_Click(object sender, EventArgs e)
 {
     globalVariables.b_QMS_Stop = true;
     try
     {
         if (_QMSScreen != null && !(isQMSActive(_QMSScreen.Name)))
         {
             _QMSScreen.Close();
             _QMSScreen.Dispose();
             _QMSScreen = null;
         }
         if (PropertyLib._HISQMSProperties.IsQMS)
         {
             Utility.EnableButton(cmdStop, false);
             new Update(KcbQm.Schema)
                 .Set(KcbQm.Columns.TrangThai).EqualTo(0)
                 .Set(KcbQm.Columns.MaQuay).EqualTo(string.Empty)
                 .Where(KcbQm.Columns.MaQuay).IsEqualTo(PropertyLib._HISQMSProperties.MaQuay)
                 .And(KcbQm.Columns.MaKhoakcb).IsEqualTo(globalVariables.MA_KHOA_THIEN)
                 .AndExpression(KcbQm.Columns.MaDoituongKcb).IsEqualTo("ALL").Or(KcbQm.Columns.MaDoituongKcb).IsEqualTo(PropertyLib._HISQMSProperties.MaDoituongKCB).CloseExpression()
                 .And(KcbQm.Columns.LoaiQms).IsEqualTo(chkUuTien.Checked ? 1 : 0)
                 .And(KcbQm.Columns.TrangThai).IsEqualTo(1)
                 .Execute();
             Thread.Sleep(200);
             Utility.EnableButton(cmdStop, true);
         }
     }
     catch (Exception exception)
     {
     }
     ModifyQMS();
 }