示例#1
0
 private void SetsyncDateTime()
 {
     SystemTime updatedTime = new SystemTime();
     DateTime dateTime = new LoginService().GetSysDateTime();
     updatedTime.DayOfWeek = (short)dateTime.DayOfWeek;
     updatedTime.Year = (short)dateTime.Year;
     updatedTime.Month = (short)dateTime.Month;
     updatedTime.Day = (short)dateTime.Day;
     updatedTime.Hour = (short)dateTime.Hour;
     updatedTime.Minute = (short)dateTime.Minute;
     updatedTime.Second = (short)dateTime.Second;
     SetLocalTime(ref updatedTime);
 }
示例#2
0
        /// <summary>
        /// hàm thực hienj việc lưu lại thông itn 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="eventArgs"></param>
        private void txtUserName_LostFocus(object  sender,EventArgs eventArgs)
        {
            try
            {
                if (oldUID != Utility.sDbnull(txtUserName.Text))
                {
                    oldUID = Utility.sDbnull(txtUserName.Text);
                    globalVariables.UserName = oldUID;
                   bool isAdmin= new LoginService().isAdmin(Utility.sDbnull(oldUID));
                    DataBinding.BindDataCombox(cboKhoaKCB,
                                               THU_VIEN_CHUNG.LaydanhsachKhoaKhidangnhap(globalVariables.UserName, Utility.Bool2byte(isAdmin)),
                                               DmucKhoaphong.Columns.MaKhoaphong, DmucKhoaphong.Columns.TenKhoaphong,
                                               "---Khoa làm việc---", false);
                    cboKhoaKCB.SelectedIndex = Utility.GetSelectedIndex(cboKhoaKCB, PropertyLib._AppProperties.Makhoathien);
                    if (cboKhoaKCB.Items.Count == 1)
                        cboKhoaKCB.SelectedIndex = 0;
                }
            }
            catch (Exception ex)
            {

            }
        }
示例#3
0
        /// <summary>
        /// hàm thực hiện việc đăng nhập thông tin của khi đăng nhập Login
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frm_ChuyenKhoaKCB_Load(object sender, EventArgs e)
        {
            try
            {
                bool isAdmin = new LoginService().isAdmin(Utility.sDbnull(globalVariables.UserName));
                DataBinding.BindDataCombox(cboKhoaKCB,
                                           THU_VIEN_CHUNG.LaydanhsachKhoanoitruTheoBacsi(globalVariables.UserName, Utility.Bool2byte(isAdmin), (byte)2),
                                           DmucKhoaphong.Columns.MaKhoaphong, DmucKhoaphong.Columns.TenKhoaphong,
                                           "---Chọn khoa làm việc---", false);
                cboKhoaKCB.SelectedIndex = Utility.GetSelectedIndex(cboKhoaKCB, PropertyLib._AppProperties.Makhoathien);
            }
            catch (Exception)
            {

            }
               finally
            {
            }
        }