private void SaveCodeToDB(string email, int kod, DateTime kodGenerateDate) { try { EmailChacingDal e = new EmailChacingDal(); EmailChecking k = new EmailChecking(); k.Email = email; k.Kod = kod; k.KodGenerateDate = kodGenerateDate; e.Insert(k); } catch (Exception exp) { logger.Error(exp, "Insert Department"); throw; } }
private void btnSave_Click(object sender, EventArgs e) { EmailChacingDal emdal = new EmailChacingDal(); if (emdal.GetByCode(Convert.ToInt32(txtCod.Text), txtTextEmail.Text) == true) { Users user = new Users(); user.Email = txtTextEmail.Text; user.Code = Convert.ToInt32(txtCod.Text); user.Salt = Helper.CreateSalt(10); user.Password = Helper.GenerateSHA256Hash(txtPassword.Text, user.Salt); user.Name = txtName.Text; user.Number = txtNumber.Text; userDal.Insert(user); MessageBox.Show("Yadda saxlanildi"); } else { MessageBox.Show("Daxil etdiyiniz kod səhvdir"); } }