Exemplo n.º 1
0
        private void GetFocusUser()
        {
            if (dgvUsersInfo.CurrentRow.Index < dgvUsersInfo.Rows.Count - 1)
            {
                int indexName     = dgvUsersInfo.Columns["colName"].Index;
                int indexPassword = dgvUsersInfo.Columns["colPassword"].Index;
                int indexAuth     = dgvUsersInfo.Columns["colAuth"].Index;

                string name     = dgvUsersInfo.Rows[dgvUsersInfo.CurrentRow.Index].Cells[indexName].Value.ToString();;
                string password = dgvUsersInfo.Rows[dgvUsersInfo.CurrentRow.Index].Cells[indexPassword].Value.ToString();
                string auth     = dgvUsersInfo.Rows[dgvUsersInfo.CurrentRow.Index].Cells[indexAuth].Value.ToString();

                if (String.IsNullOrEmpty(name) || String.IsNullOrEmpty(password))
                {
                    MessageBox.Show(ResourceCulture.GetValue("UserNameNoEmpty"), "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                    return;
                }
                if (String.IsNullOrEmpty(auth))
                {
                    MessageBox.Show("请输入用户权限(操作员/管理员)!", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
                    return;
                }

                m_currentUser          = new User();
                m_currentUser.Name     = name;
                m_currentUser.Password = password;
                m_currentUser.Auth     = auth;

                txtNameInfo.Text     = name;
                txtPasswordInfo.Text = password;
                cmbCurAuth.Text      = auth;
            }
        }
Exemplo n.º 2
0
        private void SetCulture()
        {
            dgvUsersInfo.Columns["colEmpNo"].HeaderText    = ResourceCulture.GetValue("EmpNo");
            dgvUsersInfo.Columns["colName"].HeaderText     = ResourceCulture.GetValue("UserName");
            dgvUsersInfo.Columns["colPassword"].HeaderText = ResourceCulture.GetValue("Password");
            dgvUsersInfo.Columns["colAuth"].HeaderText     = ResourceCulture.GetValue("Auth");

            Text                 = ResourceCulture.GetValue("OMCS");
            grbAddUser.Text      = ResourceCulture.GetValue("AddUser");
            labEmpNo.Text        = ResourceCulture.GetValue("EmpNo");
            labUserName.Text     = ResourceCulture.GetValue("UserName");
            labPassword.Text     = ResourceCulture.GetValue("Password");
            labAuth.Text         = ResourceCulture.GetValue("Auth");
            btnAdd.UIText        = ResourceCulture.GetValue("Add");
            btnReset.UIText      = ResourceCulture.GetValue("Reset");
            grbCurrentUser.Text  = ResourceCulture.GetValue("SelectedUser");
            labUserCur.Text      = ResourceCulture.GetValue("UserName");
            labPasswordCur.Text  = ResourceCulture.GetValue("Password");
            labAuthCur.Text      = ResourceCulture.GetValue("Auth");
            btnUpdate.UIText     = ResourceCulture.GetValue("Update");
            btnModify.UIText     = ResourceCulture.GetValue("Modify");
            btnDelete.UIText     = ResourceCulture.GetValue("Delete");
            chkShowPassword.Text = ResourceCulture.GetValue("Show");

            cmbAuth.Items.Clear();
            cmbCurAuth.Items.Clear();

            auths = new object[] { ResourceCulture.GetValue("Operator"), ResourceCulture.GetValue("Admin") };
            cmbAuth.Items.AddRange(auths);
            cmbCurAuth.Items.AddRange(auths);

            cmbAuth.SelectedIndex    = 0;
            cmbCurAuth.SelectedIndex = 0;
        }
Exemplo n.º 3
0
        private bool JudgeData()
        {
            m_weldFlow     = Convert.ToDouble(numWeldFlow.Value);
            m_weldPower    = Convert.ToDouble(numWeldPower.Value);
            m_weldSpeed    = Convert.ToDouble(numWeldSpeed.Value);
            m_weldPressure = Convert.ToDouble(numWeldPressure.Value);

            m_weldFlowUp     = Convert.ToDouble(numWeldFlowUp.Value);
            m_weldPowerUp    = Convert.ToDouble(numWeldPowerUp.Value);
            m_weldSpeedUp    = Convert.ToDouble(numWeldSpeedUp.Value);
            m_weldPressureUp = Convert.ToDouble(numWeldPressureUp.Value);

            if (m_weldFlow > m_weldFlowUp)
            {
                MessageBox.Show(ResourceCulture.GetValue("WeldFlowMoreLimit"));
                return(false);
            }
            if (m_weldPower > m_weldPowerUp)
            {
                MessageBox.Show(ResourceCulture.GetValue("WeldPowerMoreLimit"));
                return(false);
            }
            if (m_weldSpeed > m_weldSpeedUp)
            {
                MessageBox.Show(ResourceCulture.GetValue("WeldSpeedMoreLimit"));
                return(false);
            }
            if (m_weldPressure > m_weldPressureUp)
            {
                MessageBox.Show(ResourceCulture.GetValue("WeldPressMoreLimit"));
                return(false);
            }
            return(true);
        }
Exemplo n.º 4
0
        public void DoSomething()
        {
            this.lblMessage.Text = ResourceCulture.GetString(TIME_OUT);

            this.lblConfirm.Click -= new System.EventHandler(this.lblConfirm_Click);
            this.lblConfirm.Click += new System.EventHandler(this.lblConfirm_Clk);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Query exam information
        /// </summary>
        private void QueryExamInfo()
        {
            int examId = FormPassValue.examId;
            var exam   = examManager.GetExamById(examId);

            //just get one record
            foreach (var item in exam)
            {
                FormPassValue.eachQuestionPoint = item.single_question_score;
                FormPassValue.passCriteria      = item.pass_criteria;

                FormPassValue.examName = item.exam_name;
                this.lblNameValue.Text = FormPassValue.examName;
                this.lblIdValue.Text   = EOO + examId;

                DateTime TmpEffectiveTime = item.effective_time;
                effectiveTime = TmpEffectiveTime;
                FormPassValue.effectiveTime     = TmpEffectiveTime;
                this.lblEffectiveTimeValue.Text = TmpEffectiveTime.ToString();

                FormPassValue.endTime      = TmpEffectiveTime.AddMinutes(item.duration);
                this.lblEndTimeValue.Text  = FormPassValue.endTime.ToString();
                FormPassValue.duration     = item.duration;
                this.lblDurationvalue.Text = FormPassValue.duration + ResourceCulture.GetString(Min);

                FormPassValue.totalScore     = item.total_score;
                this.lblTotalScoreValue.Text = FormPassValue.totalScore.ToString();

                FormPassValue.questionQuantity  = item.question_quantity;
                this.lblQuestionCountValue.Text = FormPassValue.questionQuantity.ToString();
            }
        }
Exemplo n.º 6
0
        private void ModifyPasswordForm_Load(object sender, EventArgs e)
        {
            //标题栏文字
            this.Text = ResourceCulture.GetString("ModifyPasswordForm_text");

            InitLanguage();
        }
Exemplo n.º 7
0
        void GetToDeleteEmployeeDetail(Employee employeeToDelete)
        {
            string fullName = employeeToDelete.FirstName + "." + employeeToDelete.LastName;

            Console.WriteLine(ResourceCulture.GetString("DeleteWarning1") + " " + fullName + ResourceCulture.GetString("DeleteWarning2"));

            ConsoleKey inputCommand = Console.ReadKey().Key;

            if (inputCommand == ConsoleKey.D)
            {
                EmployeeEntity employeeEntity = new EmployeeEntity();

                bool result = employeeEntity.DeleteEmployee(employeeToDelete.EmployeeId);
                if (result)
                {
                    Console.WriteLine("\n\n" + ResourceCulture.GetString("DeleteSuccessInfo") + "\n");
                }
                else
                {
                    Console.WriteLine("\n\n" + ResourceCulture.GetString("DeleteFailInfo") + "\n");
                }
            }
            else if ((inputCommand == ConsoleKey.Escape))
            {
                EmployeePage employeePage = new EmployeePage();
                employeePage.DisplayMainPage();
                employeePage.OperateMainPage();
            }
            else
            {
                return;
            }
        }
 private void TbSearch_Leave(object sender, EventArgs e)
 {
     if (this.tbSearch.Text.Trim().Equals(string.Empty))
     {
         this.tbSearch.Text = ResourceCulture.GetString(SEARCH_MES);
     }
 }
Exemplo n.º 9
0
        public void DisplayLoginPage()
        {
            string       inputId      = null;
            bool         isValid      = false;
            CommonEntity commonEntity = new CommonEntity();

            ResourceCulture.SetCurrentCulture("en-US");

            Console.WriteLine(ResourceCulture.GetString("LoginTips") + "\n");
            while (!isValid)
            {
                inputId = Console.ReadLine().Trim();
                isValid = commonEntity.IsValidId(inputId);
                if (!isValid)
                {
                    Console.WriteLine(ResourceCulture.GetString("LoginInputError") + "\n" + ResourceCulture.GetString("LoginTips"));
                }
            }

            bool isExist = new SecurityEntity().Login(Convert.ToInt32(inputId));

            if (!isExist)
            {
                Console.WriteLine(ResourceCulture.GetString("LoginNonExistError"));
                DisplayLoginPage();
            }
        }
Exemplo n.º 10
0
        private void SettingsForm_Load(object sender, EventArgs e)
        {
            InitLanguage();

            //加载语言设置
            string region = ResourceCulture.GetCurrentCultureName();

            //初始化RadioButton的选择状态
            foreach (RadioButton item in groupBox1.Controls)
            {
                //rb_en_US
                string name = item.Name;

                //en_US
                string temp = name.Substring(name.IndexOf('_') + 1);
                item.Text = ResourceCulture.GetString(temp);

                //en-US
                string curRegion = temp.Replace('_', '-');
                if (curRegion.Equals(region))
                {
                    item.Checked = true;
                }
                else
                {
                    item.Checked = false;
                }
            }
        }
Exemplo n.º 11
0
        private void GoPageOperation(TextBox textBox)
        {
            if (textBox.Text.Equals(string.Empty))
            {
                customTipDialog.TipMessage = ResourceCulture.GetString(TIP_PAGE_INPUT);
                myOpaqueLayer.Show();
                myOpaqueLayer.Tag = customTipDialog;
                customTipDialog.Show();
                return;
            }

            int goPageNum = 1;

            try
            {
                goPageNum    = int.Parse(textBox.Text);
                textBox.Text = string.Empty;
                if (goPageNum <= 0)
                {
                    goPageNum = 1;
                }
                else if (goPageNum > TotalPage)
                {
                    goPageNum = TotalPage;
                }
            }
            catch (FormatException exception)
            {
                Console.WriteLine(exception.Message);
            }

            CurrentPage = goPageNum;
            custQuery();
            CustPagination(CurrentPage, TotalPage);
        }
Exemplo n.º 12
0
        private void ButtonOutExcel(string sqlSelectFinal)
        {
            if (CurrentProductTable == null || CurrentProductTable.Rows.Count == 0)
            {
                dgvLookBoard.DataSource = CurrentProductTable;
                MessageBox.Show(ResourceCulture.GetValue("NotData"));
                return;
            }

            SaveFileDialog saveFile = new SaveFileDialog();

            saveFile.Title       = "保存导出文件";
            saveFile.Filter      = "导出数据文件(.csv) | *.csv";
            saveFile.FilterIndex = 1;
            if (saveFile.ShowDialog() == DialogResult.OK)
            {
                m_main.AddTips("正在导出数据,请稍等...", false);

                //ThreadPool.QueueUserWorkItem((t =>
                //{
                Task.Factory.StartNew(() =>
                {
                    ExcelProductTable = m_main.DbTool.SelectTable(sqlSelectFinal);
                    ExportExcel(saveFile.FileName);
                });
                //}));
            }
        }
Exemplo n.º 13
0
        //下一页
        private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if (CurrentProductTable == null || CurrentProductTable.Rows.Count < 1)
            {
                return;
            }

            Inum++;

            if (Inum <= PageCount)              //如果没有超出总页数
            {
                //ShowPage(Inum, PageSize);

                Remain = AllCount % PageSize;
                if (Inum == PageCount && Remain != 0)
                {
                    ShowPage(Inum, Remain);
                }
                else
                {
                    ShowPage(Inum, PageSize);
                }
            }
            else
            {
                MessageBox.Show(ResourceCulture.GetValue("IsLastPage"));
                Inum = PageCount;
                return;
            }
            txtCurPage.Text = Inum.ToString();
        }
Exemplo n.º 14
0
        private void SetResourceCulture()
        {
            dgvLogError.Columns["colContent"].HeaderText    = ResourceCulture.GetValue("LogContent");
            dgvLogError.Columns["colResult"].HeaderText     = ResourceCulture.GetValue("LogResult");
            dgvLogError.Columns["colHappenTime"].HeaderText = ResourceCulture.GetValue("HappenTime");
            dgvLogError.Columns["colDealTime"].HeaderText   = ResourceCulture.GetValue("DealTime");

            grbSelectLog.Text       = ResourceCulture.GetValue("SelectLog");
            grbEditLog.Text         = ResourceCulture.GetValue("EditLog");
            labSelectMethod.Text    = ResourceCulture.GetValue("SelectMethod");
            labSelectValue.Text     = ResourceCulture.GetValue("QueryValue");
            labDealTime.Text        = ResourceCulture.GetValue("DealTime");
            labHappenTime.Text      = ResourceCulture.GetValue("HappenTime");
            labLogContent.Text      = ResourceCulture.GetValue("LogContent");
            labLogResult.Text       = ResourceCulture.GetValue("LogResult");
            btnSelect.UIText        = ResourceCulture.GetValue("Query");
            btnSelectLastTen.UIText = ResourceCulture.GetValue("SelectLatestLog");
            btnUpdate.UIText        = ResourceCulture.GetValue("Modify");
            btnDelete.UIText        = ResourceCulture.GetValue("Delete");
            btnRecord.UIText        = ResourceCulture.GetValue("Record");

            cmbSelectCondition.Items.Clear();
            cmbSelectCondition.Items.AddRange(new string[] { ResourceCulture.GetValue("LogResult"), ResourceCulture.GetValue("HappenTime"),
                                                             ResourceCulture.GetValue("DealTime"), ResourceCulture.GetValue("KeyWords") });
            cmbSelectCondition.SelectedIndex = 0;

            cmbLogResult.Items.Clear();
            cmbSelectResult.Items.Clear();
            cmbLogResult.Items.AddRange(new string[] { ResourceCulture.GetValue("Handled"), ResourceCulture.GetValue("Untreated") });
            cmbSelectResult.Items.AddRange(new string[] { ResourceCulture.GetValue("Handled"), ResourceCulture.GetValue("Untreated") });
            cmbLogResult.SelectedIndex = cmbSelectResult.SelectedIndex = 0;
        }
Exemplo n.º 15
0
        public void UpdateEmployee()
        {
            Console.WriteLine("\n\n");
            Console.WriteLine(ResourceCulture.GetString("UpdateInfo"));

            Employee     employeeItem = new Employee();
            CommonEntity eommonEntity = new CommonEntity();
            bool         valid        = false;
            string       inputId      = null;

            Console.WriteLine(ResourceCulture.GetString("IdInputTips"));
            inputId = Console.ReadLine().Trim();
            while (!valid)
            {
                valid = eommonEntity.IsValidId(inputId);
                if (!valid)
                {
                    Console.WriteLine(ResourceCulture.GetString("IdInputError"));
                    inputId = Console.ReadLine().Trim();
                }
            }
            employeeItem.EmployeeId = Convert.ToInt32(inputId);

            List <Employee> searchedEmployee = new EmployeeEntity().PreciceSearchEmployee(employeeItem.EmployeeId);

            if (searchedEmployee == null)
            {
                Console.WriteLine(ResourceCulture.GetString("SearchedZeroInfo") + "\n");
            }
            else
            {
                new EmployeePage().DisplayEmployee(searchedEmployee);
                GetToUpdateEmployeeDetail(searchedEmployee[0]);
            }
        }
Exemplo n.º 16
0
 //globalization
 private void SetResourceCulture()
 {
     this.lblLanguage.Text            = ResourceCulture.GetString(Constants.LANGUAGE);
     this.lblHome.Text                = ResourceCulture.GetString(HOME);
     this.lblMyExam.Text              = ResourceCulture.GetString(MY_EXAM);
     this.lblExamList.Text            = ResourceCulture.GetString(EXAMLIST);
     this.lblLogout.Text              = ResourceCulture.GetString(Constants.LOGOUT);
     this.lblUserInfoTab.Text         = ResourceCulture.GetString(BASIC_INFORMAION);
     this.lblChangePassword.Text      = ResourceCulture.GetString(CHANGE_PASSWORD);
     this.lblInformation.Text         = ResourceCulture.GetString(BASIC_INFORMAION);
     this.lblBasic.Text               = ResourceCulture.GetString(BASIC_INFORMAION);
     this.lblUsernameKey.Text         = ResourceCulture.GetString(USERNAMES);
     this.lblChineseNameKey.Text      = ResourceCulture.GetString(CHINESE_NAME);
     this.lblIDLeft.Text              = ResourceCulture.GetString(ID);
     this.lblGenderLeft.Text          = ResourceCulture.GetString(GENDER);
     this.lblRoleTypeLeft.Text        = ResourceCulture.GetString(ROLE_TYPE);
     this.lblTelephoneNumberLeft.Text = ResourceCulture.GetString(TELEPHONE_NUMBER);
     this.lblEmailLeft.Text           = ResourceCulture.GetString(EMAIL);
     this.lblNotConsist.Text          = ResourceCulture.GetString(NOT_CONSISTENT);
     this.lblChpUserName.Text         = ResourceCulture.GetString(USERNAME);
     this.lblPassword.Text            = ResourceCulture.GetString(PASSWORD);
     this.lblConfirmPasssword.Text    = ResourceCulture.GetString(PASSWORD_CONFIRM);
     this.lblErrorMessage.Text        = ResourceCulture.GetString(INPUT_PASSWORD);
     this.lblErrorMessageTwo.Text     = ResourceCulture.GetString(INPUT_PASSWORD);
     this.lblCancel.Text              = ResourceCulture.GetString(CANCEL);
     this.lblSubmit.Text              = ResourceCulture.GetString(SUBMITS);
     this.btnAdd.Text                = ResourceCulture.GetString(ADD_PHOTO);
     this.btnSubmit.Text             = ResourceCulture.GetString(SET_AVATAR);
     this.customTipDialog.TipMessage = ResourceCulture.GetString(CHANGE_PASSWORD_SUCCESS);
     this.customTipDialog.ChangeLanguage();
 }
Exemplo n.º 17
0
        public void DisplayEmployee(List <Employee> employeeList)
        {
            string displayResult = null;

            Console.WriteLine("\n\n");
            if (employeeList != null)
            {
                displayResult  = employeeList.Count + " " + ResourceCulture.GetString("ResultCountInfo") + "\n\n";
                displayResult += ResourceCulture.GetString("ResultTitle") + "\n";
                string name;

                employeeList.Sort();
                foreach (Employee empItem in employeeList)
                {
                    displayResult += empItem.EmployeeId.ToString().PadLeft(6) + "|";
                    name           = empItem.FirstName + "." + empItem.LastName;
                    displayResult += name.PadLeft(10) + "|";
                    displayResult += empItem.Gender.PadLeft(8) + "|";
                    displayResult += empItem.Birth.ToString("yyyy-MM-dd").PadRight(12) + "|";
                    displayResult += empItem.Address.PadLeft(13) + "|";
                    displayResult += empItem.Phone.PadRight(15) + "|";

                    displayResult += "\n";
                }
                Console.WriteLine(displayResult);
            }
            else
            {
                Console.WriteLine(ResourceCulture.GetString("SearchedZeroInfo") + "\n");
            }
        }
Exemplo n.º 18
0
 private void txtUsername_Leave(object sender, EventArgs e)
 {
     if (this.txtUsername.Text.Trim().Equals(string.Empty))
     {
         this.txtUsername.Text = ResourceCulture.GetString(USERNAME);
     }
 }
Exemplo n.º 19
0
        private void SendMsg()
        {
            string content = tb_input.Text;

            if (string.IsNullOrEmpty(content))
            {
                return;
            }

            if (content.Length > MAXLEN_MSG)
            {
                MyMessageBox.Show(ResourceCulture.GetString("msg_too_long"));
                tb_input.Focus();
                tb_input.SelectAll();
                return;
            }

            Msg msg = new Msg(LoginStatus.UserInfo.Name, patientName, content);

            if (MyIMClient.SendMsg(msg))
            {
                ShowMsg(msg);

                tb_input.Text = "";
                tb_input.Focus();
            }
            else
            {
                MyMessageBox.Show(ResourceCulture.GetString("send_failed"));
            }
        }
Exemplo n.º 20
0
        private void ValidateAndSubmit()
        {
            this.lblErrorMessage.Hide();
            this.lblErrorMessageTwo.Hide();
            this.lblNotConsist.Hide();

            bool flag = true;

            if (this.txtPassword.Text.Trim().Equals(string.Empty))
            {
                this.lblErrorMessage.Text = ResourceCulture.GetString(INPUT_PASSWORD);;
                this.lblErrorMessage.Show();
                flag = false;
            }

            if (this.txtPasswordTwo.Text.Trim().Equals(string.Empty))
            {
                this.lblErrorMessageTwo.Text = ResourceCulture.GetString(INPUT_PASSWORD);
                this.lblErrorMessageTwo.Show();
                flag = false;
            }

            if (!this.txtPassword.Text.Trim().Equals(this.txtPasswordTwo.Text.Trim()) && !this.txtPassword.Text.Trim().Equals(string.Empty) &&
                !this.txtPasswordTwo.Text.Trim().Equals(string.Empty))
            {
                this.lblNotConsist.Show();
                flag = false;
            }

            if (!this.txtPassword.Text.Trim().Equals(string.Empty) && this.txtPassword.Text.Trim().Length > maxPassLength)
            {
                this.lblErrorMessage.Text = ResourceCulture.GetString(PASSWORD_TOO_LONG);
                this.lblErrorMessage.Show();
            }

            if (!this.txtPasswordTwo.Text.Trim().Equals(string.Empty) && this.txtPasswordTwo.Text.Trim().Length > maxPassLength)
            {
                this.lblErrorMessageTwo.Text = ResourceCulture.GetString(PASSWORD_TOO_LONG);
                this.lblErrorMessageTwo.Show();
            }

            if (!flag)
            {
                return;
            }
            else
            {
                string encryptPassword = EncryptUtils.EncryptPassword(this.txtPassword.Text.Trim());
                userManager.UpdatePassword(encryptPassword, RememberUserParameter.userId);

                this.myOpaqueLayer.Show();
                this.customTipDialog.Tag        = this.myOpaqueLayer;
                this.customTipDialog.TipMessage = ResourceCulture.GetString(CHANGE_PASSWORD_SUCCESS);
                this.customTipDialog.Show();
                this.txtPassword.Text    = string.Empty;
                this.txtPasswordTwo.Text = string.Empty;
                this.customTipDialog.Focus();
            }
        }
Exemplo n.º 21
0
        private void SetResourceCulture()
        {
            Text = ResourceCulture.GetValue("ManualCheck");

            labReason.Text      = ResourceCulture.GetValue("ModifyReason");
            labFinalResult.Text = ResourceCulture.GetValue("FinalResult");
            btnUpdate.UIText    = ResourceCulture.GetValue("Modify");
        }
Exemplo n.º 22
0
        private void InitLanguage()
        {
            this.Text       = ResourceCulture.GetString("SettingsForm_text");
            btn_cancel.Text = ResourceCulture.GetString("btn_cancel");
            btn_save.Text   = ResourceCulture.GetString("btn_save");

            groupBox1.Text = ResourceCulture.GetString("language");
        }
Exemplo n.º 23
0
        public TipForm()
        {
            InitializeComponent();

            this.lblMessage.Text = ResourceCulture.GetString(FORGET_PASSWORD);
            this.lblConfirm.Text = ResourceCulture.GetString(CONFIRM);
            this.lblCancel.Text  = ResourceCulture.GetString(CANCEL);
        }
Exemplo n.º 24
0
 //globalization
 public void SetCulture()
 {
     this.lblTitle.Text           = ResourceCulture.GetString(RESET_PASWORD);
     this.lblVerification.Text    = ResourceCulture.GetString(VERIFICATION_CODE);
     this.lblPassword.Text        = ResourceCulture.GetString(PASSWORD);
     this.lblPasswordConfirm.Text = ResourceCulture.GetString(PASSWORD_CONFIRM);
     this.btnConfirm.Text         = ResourceCulture.GetString(CONFIRM);
 }
Exemplo n.º 25
0
 private void SetResourceCulture()
 {
     this.txtUsername.Text   = ResourceCulture.GetString(USERNAME);
     this.txtPassword.Text   = ResourceCulture.GetString(PASSWORD);
     this.btnLogin.Text      = ResourceCulture.GetString(LOGIN);
     this.ckxRemember.Text   = ResourceCulture.GetString(REM);
     this.lblForgetPass.Text = ResourceCulture.GetString(FORGET);
 }
Exemplo n.º 26
0
 private void txtPassword_Leave(object sender, EventArgs e)
 {
     if (this.txtPassword.Text.Trim().Equals(string.Empty))
     {
         this.txtPassword.PasswordChar = defaultValue;
         this.txtPassword.Text         = ResourceCulture.GetString(PASSWORD);
     }
 }
Exemplo n.º 27
0
 private void SetResourceCulture()
 {
     this.lblLanguage.Text = ResourceCulture.GetString(Constants.LANGUAGE);
     this.tbSearch.Text    = ResourceCulture.GetString(SEARCH_MES);
     this.lblHome.Text     = ResourceCulture.GetString(EXAMLIST);
     this.lblLogout.Text   = ResourceCulture.GetString(Constants.LOGOUT);
     this.customTipDialog1.ChangeLanguage();
 }
Exemplo n.º 28
0
 private void SetResourceCulture()
 {
     Text             = ResourceCulture.GetValue("LoginTips");
     labName.Text     = ResourceCulture.GetValue("UserName");
     labPassword.Text = ResourceCulture.GetValue("Password");
     btnOK.UIText     = ResourceCulture.GetValue("OK");
     btnCancel.UIText = ResourceCulture.GetValue("Cancel");
 }
Exemplo n.º 29
0
        //start take exam
        private void StartTest_Click(object sender, EventArgs e)
        {
            ExamDS.exam_exceptionDataTable datatable = examManager.GetExceptionOccurTime(RememberUserParameter.userId, FormPassValue.examId);
            FormPassValue.currentWindowState = this.WindowState;

            //exception
            if (datatable.Rows.Count > 0)
            {
                DateTime exceptiontime;
                var      rs = from dt in datatable select new { dt.occur_time };

                foreach (var item in rs)
                {
                    exceptiontime = item.occur_time;
                }

                //if (DateTime.Now - exceptiontime)
                //whether add exption duration to endtime
                int haveAnsweredNum = questionManager.QueryHaveAnsweredQuestionNumber(RememberUserParameter.userId, FormPassValue.examId);

                //begin from which question
                FormPassValue.questionSerial = haveAnsweredNum + 1;
                this.DialogResult            = DialogResult.OK;
            }
            else
            //normal
            {
                TimeSpan tsNow        = new TimeSpan((DateTime.Now).Ticks);
                TimeSpan tsEffective  = new TimeSpan(effectiveTime.Ticks);
                double   timeInterval = tsEffective.Subtract(tsNow).TotalSeconds;
                bool     result       = examManager.ValidationIsHasTokenExam(RememberUserParameter.userId, FormPassValue.examId);

                if (timeInterval > 0)
                {
                    this.lblHintMessage.Text = ResourceCulture.GetString(HAVE_NOT_START_MESSAGE);
                    this.pnlHint.Visible     = true;
                }
                else if (result == true)
                {
                    this.lblHintMessage.Text = ResourceCulture.GetString(HAVE_TOKEN_EXAM);
                    this.pnlHint.Visible     = true;
                }
                else
                {
                    TimeSpan tsEnd           = new TimeSpan(FormPassValue.endTime.Ticks);
                    double   endTimeInterval = tsNow.Subtract(tsEnd).TotalSeconds;

                    if (endTimeInterval >= 0)
                    {
                        this.lblHintMessage.Text = ResourceCulture.GetString(HAVE_END);
                        this.pnlHint.Visible     = true;
                        return;
                    }

                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Exemplo n.º 30
0
 public ExRecordModel(RecordModel record)
 {
     this.Description = record.Description;
     this.Record_id   = record.Record_id;
     this.Time        = record.Time;
     this.User_id     = record.User_id;
     this.Citycode    = record.Citycode;
     this.Area        = GeneralHelper.GetAreaName(this.Citycode, ResourceCulture.GetCurrentCultureName());
 }