public ViewResult Profile(RegForm FromForm) { if (ModelState.IsValid) { return(View("Profile", FromForm)); } else { return(RegForm()); } }
private void metroButton17_Click(object sender, EventArgs e) { if (ActiveMdiChild != null) { ActiveMdiChild.Close(); } RegForm newMDIChild = new RegForm(); // Set the Parent Form of the Child window. newMDIChild.MdiParent = this; // Display the new form. newMDIChild.Show(); newMDIChild.Dock = DockStyle.Fill; }
private void Sign_up_Click(object sender, EventArgs e) { this.Enabled = false; Form RegForm; if (isManager.Checked) { RegForm = new Registry_form(); } else { RegForm = new reader_reg_form(); } RegForm.Show(); }
public bool UpdateForm(RegForm reg) { if (string.IsNullOrEmpty(reg.BillId)) { _query = $"UPDATE dbo.REG_FORM SET CheckOut = GETDATE(), Rental = {reg.Rental} WHERE FormId = {reg.FormId}"; } else { _query = $"UPDATE dbo.REG_FORM SET CheckOut = GETDATE(), Rental = {reg.Rental}, BillId = '{reg.BillId}' WHERE FormId = {reg.FormId}"; } var result = DataProvider.Instance.ExecuteNonQuery(_query); return(result > 0); }
public void EmployeesInsertCheck() { // Тест на добавление пользователя int countbefore = ForTest.Countrecords("Employees"); RegForm form = new RegForm(); form.nameBox.Text = "Влад"; form.surnameBox.Text = "Харитонов"; form.patronymicBox.Text = "Ванович"; form.emailBox.Text = "*****@*****.**"; form.passportID.Text = "123456789"; form.buttonSubmit_Click(null, null); int countafter = ForTest.Countrecords("Employees"); Assert.AreEqual(countafter - 1, countbefore); }
public async Task <IActionResult> Register([FromBody] RegForm data) { try { if (!Helper.isRightName(data.Name)) { return(BadRequest(Errors.BadName)); } if (_context.Users.FirstOrDefault(u => u.Email == data.Email) != null) { return(BadRequest(Errors.EmailTaken)); } var limit = DateTime.UtcNow.Subtract(new TimeSpan(1, 0, 0)).Ticks; var range = _context.RegQueue.Where(e => e.Date < limit); _context.RegQueue.RemoveRange(range); var rand = new Random(); string key; do { key = rand.Next(100000000, 999999999).ToString(); }while (_context.RegQueue.FirstOrDefault(e => e.Key == key) != null); await _context.RegQueue.AddAsync(new RegQueueEntity { Key = key, Date = DateTime.UtcNow.Ticks, Name = data.Name, Email = data.Email, Password = data.Password }); await _context.SaveChangesAsync(); string content = $"Hello {data.Name}. Please follow the link to confirm your email addresss.\n{Helper.Settings.EmailConfirmAddr + key}"; if (!await Helper.SendMail(data.Email, content)) { throw new Exception("Failed to send a confirmation email."); } return(Ok("ok")); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex)); } }
private void backBtn_Click(object sender, EventArgs e) { RegForm.Show(); this.Close(); }
public void BeginCheck() { string AppRegFilePath = Application.StartupPath + "\\AppRun.dll"; #region //测试版先不连接地址院的校验服务器 //if(!MyMethod.CheckFileExists(AppRegFilePath)) //{ // //第一次运行,由于没有注册文件,所以先到服务器上拉取一下,比较慢,出进度条 // curProgress = new ProgressForm("正在为第一次运行做准备……"); // curProgress.Show(parentForm); // //parentForm.Enabled = false; //} ////先连接服务器,调用更新文件 //DownLoadRegFile opUpdateRegFile = new DownLoadRegFile(); //opUpdateRegFile.BeginOp(); //if (curProgress != null) //{ // curProgress.Close(); // //parentForm.Enabled = true; //} #endregion //如果没有注册文件,要检测是否是第一次安装 if (!MyMethod.CheckFileExists(AppRegFilePath)) { //获取数据库中的标识 if (GetAccessRegInfo(opDB)) { //如果第一次安装,密码存储应为null if (dt_AcessReg.Rows.Count > 0) { string TempValue = dt_AcessReg.Rows[0]["psw"].ToString(); if (string.IsNullOrEmpty(TempValue)) { //确认为第一次安装,启动相关模块 RegForm form = new RegForm(opDB); ////默认一个月 ////form.text_RegDW.Text = "培训专用"; ////form.date_UseDataLimite.Value = "2015-11-10".ConvertDate("yyyy-MM-dd"); ////form.btn_Reg_Click(null, null); ////手工注册使用 form.TopMost = true; form.ShowDialog(parentForm); form.Dispose(); string tempValue = DateTime.Now.ToString("yyyy-MM-dd"); dt_AcessReg.Rows[0]["psw"] = MyMethod.GetEecryptStr(tempValue); SaveAccessRegInfo(); } } } } BackgroundWorker back_CheckReg = new BackgroundWorker(); back_CheckReg.WorkerSupportsCancellation = true; back_CheckReg.DoWork += back_CheckReg_DoWork; back_CheckReg.RunWorkerCompleted += back_CheckReg_RunWorkerCompleted; back_CheckReg.RunWorkerAsync(); }
///注册配置 private void barBtn_authority_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { RegForm dlg = new RegForm(); dlg.ShowDialog(); }