public HandleReaderApplicationForm(LibraryDBContainer dbContext, ReaderApplication readerApplication) { this.dbContext = dbContext; this.readerApplication = readerApplication; InitializeComponent(); PopulateData(); }
private void btnHandleApplication_Click(object sender, EventArgs e) { ReaderApplication application = (ReaderApplication)GuiUtils.GetSelected <ReaderApplication>(lstViewActions, readerApplicationTagSet); if (application != null) { HandleReaderApplicationForm handleApplication = new HandleReaderApplicationForm(dbContext, application); handleApplication.ShowDialog(); RefreshReaderApplications(); } else { MessageBox.Show("Nie wybrano wniosku!", "Błąd"); } }
private void send_Click(object sender, EventArgs e) { if (textBoxName.Text.Count() == 0 || textBoxSurname.Text.Count() == 0 || textBoxTel.Text.Count() == 0 || textBoxStreet.Text.Count() == 0 || textBoxStrNum.Text.Count() == 0 || textBoxCity.Text.Count() == 0 || textBoxPostal.Text.Count() == 0) { MessageBox.Show("Wszystkie pola muszą być uzupełnione"); return; } if (!textBoxTel.Text.All(Char.IsDigit)) { MessageBox.Show("Telefon może zawierać tylko cyfry"); return; } if (!textBoxPostal.Text.All(x => Char.IsDigit(x) || x == '-')) { MessageBox.Show("Nieprawidłowy kod pocztowy"); return; } var applicationData = new ReaderApplicationData { Name = textBoxName.Text, Surname = textBoxSurname.Text, PhoneNumber = textBoxTel.Text, Street = textBoxStreet.Text, HouseNumber = textBoxStrNum.Text, ApartmentNumber = textBoxApt.Text, City = textBoxCity.Text, PostalCode = textBoxPostal.Text }; var application = new ReaderApplication { ApplicationDate = DateTime.Now }; application.ApplicationData.Add(applicationData); user.Application.Add(application); dbContext.SaveChanges(); MessageBox.Show("Wysłano wniosek"); this.Close(); }
private static string LOG_FILE_NAME; // 日志文件保存名称 public static void init(Context context) { // 在Application中初始化 LOG_FILE_PATH = Environment.ExternalStorageDirectory.Path + File.Separator + ReaderApplication.getsInstance().PackageName; LOG_FILE_NAME = "Log"; }