private void buttonItem2_Click(object sender, EventArgs e) { for (int n = 0; dataGridViewX1.Rows.Count - 1 > 0; n++) { #region Adder int id = 0; string first_name = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[1].Value); string Last_name = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[2].Value); string Father_name = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[3].Value); string Mather_name = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[4].Value); Int64 natiol_id = ClassConvert.Convint64(dataGridViewX1.Rows[n].Cells[8].Value); bool Gender = ClassConvert.ConvBool(dataGridViewX1.Rows[n].Cells[5].Value); string where_birth = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[6].Value); DateTime data_barthday = ClassConvert.ConvDateTime(dataGridViewX1.Rows[n].Cells[7].Value); string e_mail = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[18].Value); int Phone_Ground = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[20].Value); int Phone_Mobile1 = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[19].Value); string study = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[9].Value); int yearstudy = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[10].Value); int Id_course = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[0].Value); string Id_course_Ware = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[21].Value); DateTime data_regs = ClassConvert.ConvDateTime(dataGridViewX1.Rows[n].Cells[17].Value); int bitd_id = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[11].Value); string nameEnglish = ClassConvert.ConvString(dataGridViewX1.Rows[n].Cells[12].Value); int Z1 = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[13].Value); int z2 = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[14].Value); int z3 = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[15].Value); string Hanei_whare = ""; string Hanei_whare1 = ""; string adderas = ""; int Stutes_Jtma3 = ClassConvert.Convint(dataGridViewX1.Rows[n].Cells[16].Value); int Phone_Mobile2 = 0; string Facebook = ""; int whatsApp = 0; int viper = 0; string Twiter = ""; System.Drawing.Image Image_id_nationl1 = null; System.Drawing.Image Image_id_nationl2 = null; System.Drawing.Image image = null; System.Drawing.Image Image_font = null; string Nkname = ""; System.Xml.XmlDataDocument XmlHobbies = null;; /* * string[] liststring = System.IO.Directory.GetFiles(".\\", "Hobbis1.xml", System.IO.SearchOption.AllDirectories); * XmlHobbies.Load(liststring[0]);*/ #endregion Vitl vitltemp = new Vitl(id, first_name, Last_name, Father_name, Mather_name, natiol_id, Gender, where_birth, data_barthday, Hanei_whare, Hanei_whare1, adderas, e_mail, Stutes_Jtma3, Phone_Ground, Phone_Mobile1, Phone_Mobile2, Facebook, Twiter, whatsApp, viper, study, yearstudy, Id_course, Id_course_Ware, data_regs, Image_id_nationl1, Image_id_nationl2, image, Image_font, bitd_id, Nkname, nameEnglish, Z1, z2, z3, XmlHobbies); Sqldatabasethrding.SqlSaveVitl(vitltemp.adder()); } }
private void buttonX3_Click(object sender, EventArgs e) { for (int i = 0; i < dataGridViewX1.Rows.Count; i++) { if (ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["id"].Value) > 0) { if (ClassConvert.ConvString(dataGridViewX1.Rows[i].Cells["التاريخ"].Value) != "") { Vitl.EditbyIdRegInSARC(ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["id"].Value), ClassConvert.ConvDateTime(dataGridViewX1.Rows[i].Cells["التاريخ"].Value)); } } } }
private async void buttonX3_Click(object sender, EventArgs e) { try { dataGridViewX1.Enabled = false; ClassDataGridViewDo.ClumChekArray(NameCol, dataGridViewX1); for (int i = 0; i < dataGridViewX1.Rows.Count; i++) { int id = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["id"].Value); DateTime?NuberOfDayes = ClassConvert.ConvDateTimeNull(dataGridViewX1.Rows[i].Cells["التاريخ"].Value); string Notes = ClassConvert.ConvString(dataGridViewX1.Rows[i].Cells["ملاحظات"].Value); //أختبار هل الدورة مسجل عند الشخص + أنه تأكد من وجود ID if (id > 0) { WereDelivery CouresNew = new WereDelivery(0, WereType.WereTypeList[comboBoxEx1.SelectedIndex].id, NuberOfDayes, id, null, Notes); if (await Sqldatabasethrding.SqlSaveVitl(CouresNew.adder())) { dataGridViewX1.Rows[i].DefaultCellStyle.BackColor = Color.Green; } else { dataGridViewX1.Rows[i].DefaultCellStyle.BackColor = Color.Red; } } else { dataGridViewX1.Rows[i].DefaultCellStyle.BackColor = Color.Red; } } } catch (NoColumnsException ex) { ErrorClass.SaveErrorFile(ex); MessageBox.Show(string.Format(" لا يوجد عامود {0} ", ex.Message)); } catch (Exception ex) { ErrorClass.SaveErrorFile(ex); } buttonX3.Enabled = true; dataGridViewX1.Enabled = true; }
public static List <TypeofCouress> GetAll() { List <TypeofCouress> Lista = new List <TypeofCouress>(); System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand("SELECT [Id],[NameOfCouress],[NameTeam_Ta] FROM [dbo].[TypeofCouress_ta] where [Delete] = 0"); Task <List <List <object> > > temp = Sqldatabasethrding.GetSql(SqlComm); while (!temp.IsCompleted) { } List <List <object> > Adw = temp.Result; for (int i = 0; i < Adw.Count; i++) { if (Adw[i].Count != 0) { Lista.Add(new TypeofCouress(Convert.ToInt32(Adw[i][0]), ClassConvert.ConvString(Adw[i][1]), ClassConvert.Convint(Adw[i][2]))); } } return(Lista); }