private void Deposit_Load(object sender, EventArgs e) { Calender calender = new Calender(); Calender cl = new Calender(); DateTime d1 = DateTime.Now; txtTitle.Text = cl.MilliTimeStamp(d1); txtTitleGet.Text = cl.MilliTimeStamp(d1.AddDays(17)); }
private void button1_Click(object sender, EventArgs e) { Calender cl = new Calender(); DateTime d1 = DateTime.Now; string dateShamse = cl.MilliTimeStamp(d1); int m = each(1); if (m == 10) { Users users = new Users(); users.numberStudent = Convert.ToDouble(txtNumberStudent.Text); users.name = txtName.Text; users.family = txtFamily.Text; users.mobile = txtPhone.Text; users.codeMeli = txtCodeMeli.Text; users.certificate = txtCertificate.Text; users.born = txtBorn.Text; users.fieldStudy = txtField.Text; users.email = txtEmail.Text; users.adress = txtAddress.Text; users.picture = pic.Tag.ToString(); users.date = dateShamse; int i = users.insert(); if (i == 1) { MessageBox.Show("با موفقیت ثبت شد "); each(2); pic.Image = Image.FromFile(@"C:\Users\User\Desktop\library\pers.png"); pic.Tag = G.DEFAULT_PIC_USER; } else { MessageBox.Show(" خطا در ثبت "); } } else { MessageBox.Show("لطفا اطلاعات را کامل وارد کنید ", "هشدار"); } }
private void button1_Click(object sender, EventArgs e) { Calender cl = new Calender(); DateTime d1 = DateTime.Now; string dateShamse = cl.MilliTimeStamp(d1); if (txtTitle.Text != "" && txtYear.Text != "" && txtNumber.Text != "" && txtIsbn.Text != "" && txtPublication.Text != "" && txtC.Text != "" && panel10.Enabled) { Books books = new Books(); books.isbn = txtIsbn.Text; books.title = txtTitle.Text; books.yearPublication = Convert.ToInt16(txtYear.Text); books.numberBook = Convert.ToInt16(txtNumber.Text); books.picture = pic.Tag.ToString(); books.date = dateShamse; int i = books.insert(); for (int c = 0; c < A_id.Count(); c++) { Authors authors = new Authors(); authors.insertToBook_Writtenby(A_id[c], txtIsbn.Text); } A_id.Clear(); Publications publications = new Publications(); publications.insertToBooks_published(P_id, txtIsbn.Text); if (i == 1) { MessageBox.Show("با موفقیت ثبت شد "); //each(2); } else { MessageBox.Show(" خطا در ثبت "); } } else { MessageBox.Show("لطفا اطلاعات را کامل وارد کنید ", "هشدار"); } }