public AutoDialog(ChatContext context) { _context = context; clientState = new Dictionary <Guid, int>(); UserDataDictionary = new Dictionary <Guid, Dictionary <string, string> >(); DialogName = new Dictionary <Dialogs, string>() { { Dialogs.Booking, "Бронювання квитків" }, { Dialogs.Register, "Онлайн реєстрація" }, { Dialogs.Employee, "Звязатися з оператором" } }; DialogEmployee dialogEmployee = new DialogEmployee(_context); DialogBooking dialogBooking = new DialogBooking(); DialogRegister dialogRegister = new DialogRegister(); DialogMetodDict = new Dictionary <Dialogs, DialogMetod>() { { Dialogs.Booking, dialogBooking.DialogBookingMain }, { Dialogs.Register, dialogRegister.DialogRegisterMain }, { Dialogs.Employee, dialogEmployee.DialogEmployeeMain }, }; DefaultTextMessage = ButtonToJson(5, "Оберіть сервіс:", DialogName.Values.ToArray()); }
private void btnSave_Click(object sender, EventArgs e) { if (DialogRegister.IsRegister() == false) { MessageBox.Show("โปรแกรมชุดนี้ยังไม่ได้ลงทะเบียน ไม่สามารถบันทึกการเปลี่ยนแปลงได้", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return; } try { if (this.curr_file_path != null) { File.WriteAllText(this.curr_file_path, this.TextArea.Text.AES_Encrypt(salt)); } else { SaveFileDialog sfd = new SaveFileDialog(); sfd.CheckFileExists = false; sfd.Filter = "Report file(*.rpbi)|*.rpbi"; sfd.DefaultExt = "rpbi"; if (sfd.ShowDialog() == DialogResult.OK) { this.curr_file_path = sfd.FileName; File.WriteAllText(this.curr_file_path, this.TextArea.Text.AES_Encrypt(salt)); this.lblFileName.Text = this.curr_file_path; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void userAcButtonCreateUsr_Click(object sender, EventArgs e) { DialogRegister dialogRegister = new DialogRegister(); dialogRegister.ShowDialog(); }
private void btnRegister_Click(object sender, EventArgs e) { DialogRegister dr = new DialogRegister(); dr.ShowDialog(); }