private void Add_ıconButton_Click(object sender, EventArgs e) { Entity.Current newCurrent = new Entity.Current(); newCurrent.Code = Convert.ToInt32(code_numericUpDown.Value); newCurrent.Title = title_textBox.Text; newCurrent.Debt = Convert.ToDouble(Debt_INT_VALUE_Label.Text); newCurrent.Payee = Convert.ToDouble(payee_INT_VALUE_Label.Text); newCurrent.Address = address_textBox.Text; newCurrent.City = city_textBox.Text; newCurrent.District = disctict_textBox.Text; newCurrent.Phone1 = Convert.ToInt64(phone1_textBox.Text); newCurrent.Phone2 = Convert.ToInt64(phone2_textBox.Text); newCurrent.MobilPhone = Convert.ToInt64(mobilPhone_textBox.Text); newCurrent.TaxNo = taxNo_textBox.Text; newCurrent.PersonalID = Convert.ToInt32(personalID_textBox.Text); newCurrent.DateTime = dateTimePicker.Value.Date; newCurrent.Explain = explain_richTextBox.Text; MessageBox.Show(ORMTransactionsPage.Insert(newCurrent).ToString()); }
private void dataGridView_CellValueChanged(object sender, DataGridViewCellEventArgs e) { Entity.Current current = new Entity.Current(); current.CurrentID = (int)dataGridView.Rows[e.RowIndex].Cells[0].Value; current.Code = (int)dataGridView.Rows[e.RowIndex].Cells[1].Value; current.Title = (string)dataGridView.Rows[e.RowIndex].Cells[2].Value; current.Debt = ToDouble(e.RowIndex, 3); current.Payee = ToDouble(e.RowIndex, 4); current.Address = (string)dataGridView.Rows[e.RowIndex].Cells[5].Value; current.City = (string)dataGridView.Rows[e.RowIndex].Cells[6].Value; current.District = (string)dataGridView.Rows[e.RowIndex].Cells[7].Value; current.Phone1 = (long)dataGridView.Rows[e.RowIndex].Cells[8].Value; current.Phone2 = (long)dataGridView.Rows[e.RowIndex].Cells[9].Value; current.MobilPhone = (long)dataGridView.Rows[e.RowIndex].Cells[10].Value; current.TaxNo = (string)dataGridView.Rows[e.RowIndex].Cells[11].Value; current.PersonalID = (int)dataGridView.Rows[e.RowIndex].Cells[12].Value; current.DateTime = (DateTime)dataGridView.Rows[e.RowIndex].Cells[13].Value; current.Explain = (string)dataGridView.Rows[e.RowIndex].Cells[14].Value; MessageBox.Show( current.CurrentID.ToString() + current.Code.ToString() + current.Title.ToString() + current.Debt.ToString() + current.Payee.ToString() + current.Address.ToString() + current.City.ToString() + current.District.ToString() + current.Phone1.ToString() + current.Phone2.ToString() + current.MobilPhone.ToString() + current.TaxNo.ToString() + current.PersonalID.ToString() + current.DateTime.ToString() + current.Explain.ToString() ); //new ORM.Tables.Current.Transactions().Update(); }