private void buttonX1_Click(object sender, EventArgs e) { if (CouressEdit == null && ToAddInCores == false) { CouressEdit = new Couress(CountOfNew, EditTame.SerchByComBBox(comboBoxEx2, NameOfCouress.NameOfCouresslist), this.idVite, ClassConvert.Convint(NumberOfdayregest.Text), Convert.ToSingle(Result.Text)); CountOfNew--; this.DialogResult = System.Windows.Forms.DialogResult.Yes; } else if (CouressEdit == null && ToAddInCores && comboBoxEx1.AutoCompleteCustomSource.IndexOf(comboBoxEx1.Text) != -1) { CouressEdit = new Couress(CountOfNew, this.idVite, intList[comboBoxEx1.AutoCompleteCustomSource.IndexOf(comboBoxEx1.Text)], ClassConvert.Convint(NumberOfdayregest.Text), Convert.ToSingle(Result.Text)); CountOfNew--; this.DialogResult = System.Windows.Forms.DialogResult.Yes; } else if (ToAddInCores == false) { CouressEdit.Eidt(EditTame.SerchByComBBox(comboBoxEx2, NameOfCouress.NameOfCouresslist), this.idVite, ClassConvert.Convint(NumberOfdayregest.Text), Convert.ToSingle(Result.Text)); this.DialogResult = System.Windows.Forms.DialogResult.OK; } else if (ToAddInCores && comboBoxEx1.AutoCompleteCustomSource.IndexOf(comboBoxEx1.Text) != -1) { CouressEdit.Eidt(intList[comboBoxEx1.SelectedIndex], this.idVite, ClassConvert.Convint(NumberOfdayregest.Text), Convert.ToSingle(Result.Text)); this.DialogResult = System.Windows.Forms.DialogResult.OK; } this.Close(); }
private async void buttonX2_Click(object sender, EventArgs e) { if (!dataGridViewX1.Columns.Contains("تاريخ1")) { dataGridViewX1.Columns.Add("تاريخ1", "تاريخ"); } if (!dataGridViewX1.Columns.Contains("تاريخ2")) { dataGridViewX1.Columns.Add("تاريخ2", "تاريخ"); } if (!dataGridViewX1.Columns.Contains("الاسم1")) { dataGridViewX1.Columns.Add("الاسم1", "تاريخ"); } for (int i = 0; i < dataGridViewX1.Rows.Count; i++) { if (ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["id"].Value) > 0) { IdAndName vit = await Vitl.GetbyidIdAndName(ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["id"].Value)); dataGridViewX1.Rows[i].Cells["الاسم1"].Value = vit.Name; dataGridViewX1.Rows[i].Cells["تاريخ1"].Value = vit.Regesterdeg.ToShortDateString(); dataGridViewX1.Rows[i].Cells["تاريخ2"].Value = vit.Regesterdeg.ToLongDateString(); } } }
private void buttonX2_Click(object sender, EventArgs e) { if (!dataGridViewX1.Columns.Contains("id")) { dataGridViewX1.Columns.Add("Id", "id"); } for (int i = 0; i < dataGridViewX1.Rows.Count; i++) { if (ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["id"].Value) <= 0) { string name = Convert.ToString(dataGridViewX1.Rows[i].Cells["الاسم"].Value); SerchNameBynameRetu SerchNameBynameRetu = new SerchNameBynameRetu(); SerchNameBynameRetu.sech = name; SerchNameBynameRetu.DoWorkOff(); if (SerchNameBynameRetu.Id > 0) { dataGridViewX1.Rows[i].Cells["id"].Value = SerchNameBynameRetu.Id; } else { SerchNameBynameRetu.Text = name; if (SerchNameBynameRetu.ShowDialog() == System.Windows.Forms.DialogResult.OK) { dataGridViewX1.Rows[i].Cells["id"].Value = SerchNameBynameRetu.Id; } } } } }
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_1(object sender, EventArgs e) { if (!dataGridViewX1.Columns.Contains("موجودأم لا")) { dataGridViewX1.Columns.Add("موجودأم لا", "موجودأم لا"); } for (int i = 0; i < dataGridViewX1.Rows.Count - 1; i++) { progressBarX1.BeginInvoke(new Prosser(NewProsserVaul), i); if (ClassConvert.Convint64(dataGridViewX1.Rows[i].Cells[listStringNkname2[4]].Value) > 0) { if (Vitl.GetIf(ClassConvert.Convint64(dataGridViewX1.Rows[i].Cells[listStringNkname2[4]].Value))) { dataGridViewX1.Rows[i].Cells["موجودأم لا"].Value = "غير موجود رقم وطني"; goto end; } else { dataGridViewX1.Rows[i].Cells["موجودأم لا"].Value = "موجود رقم وطني"; goto end; } } if (Convert.ToString(dataGridViewX1.Rows[i].Cells[listStringNkname2[11]].Value) != "") { if (Vitl.GetIfEmail(Convert.ToString(dataGridViewX1.Rows[i].Cells[listStringNkname2[11]].Value))) { dataGridViewX1.Rows[i].Cells["موجودأم لا"].Value = "غير موجود Email"; goto end; } else { dataGridViewX1.Rows[i].Cells["موجودأم لا"].Value = " موجود Email"; goto end; } } if (ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname2[14]].Value) != 0) { if (Vitl.GetIfmobilephon(ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname2[11]].Value))) { dataGridViewX1.Rows[i].Cells["موجودأم لا"].Value = " غير موجود رقم هاتف"; goto end; } else { dataGridViewX1.Rows[i].Cells["موجودأم لا"].Value = "موجود رقم هاتف"; goto end; } } dataGridViewX1.Rows[i].Cells["موجودأم لا"].Value = "لا يوجد وسيلة تحقق أبدا"; end :; } }
private void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { RibbonForm2 Detalis1 = new RibbonForm2(); this.Opacity = 0.5; Detalis1.idvite = ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value); Detalis1.ShowDialog(); this.Opacity = 1; } }
private void dataGridViewX1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e) { if (Convert.ToInt32(e.Row.Cells["Idcours"].Value) <= 0) { e.Cancel = true; } else { IntDeletCoress.Add(ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(e.Row.Cells["Idcours"].Value), CouressList)); } }
private async void buttonX3_Click(object sender, EventArgs e) { try { dataGridViewX1.Enabled = false; ClassDataGridViewDo.ClumChekArray(NameCol, dataGridViewX1); int IdTheNameOfcoures = NameTeam.NameTeamStatic[comboBoxEx1.SelectedIndex].id; 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); //أختبار هل الدورة مسجل عند الشخص + أنه تأكد من وجود ID if (id > 0) { Team CouresNew = new Team(0, NuberOfDayes, null, id, IdTheNameOfcoures, 1, 1); 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; }
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 void SaveMyVitlNew(int i) { int j = 0; int id = 0; string first_name = dataGridViewX1.Rows[i].Cells[listStringNkname1[j]].Value.ToString(); string Last_name = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); string Father_name = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); string Mather_name = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); Int64 natiol_id = ClassConvert.Convint64(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); bool? Gender = ClassConvert.ConvBoolMelaFemalNUll(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); string where_birth = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); DateTime data_barthday = ClassConvert.ConvDateTime(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); string Hanei_whare = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); string Hanei_whare1 = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); string adderas = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); string e_mail = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); int Stutes_Jtma3 = ClassConvert.ConvToStatesF(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); int Phone_Ground = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); int Phone_Mobile1 = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); int Phone_Mobile2 = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); string Facebook = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); int whatsApp = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); int viper = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); string Twiter = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); string study = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); int yearstudy = ClassConvert.ConvToStady(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value);; int Id_course = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); string Id_course_Ware = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); DateTime data_regs = ClassConvert.ConvDateTime(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); 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; int bitd_id = ClassConvert.ConvintBoloed(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); string Nkname = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); string nameEnglish = dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value.ToString(); int Z1 = ClassConvert.ConvSizeToint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); int z2 = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); int z3 = ClassConvert.ConvSizeToint(dataGridViewX1.Rows[i].Cells[listStringNkname1[++j]].Value); System.Xml.XmlDataDocument XmlHobbies = null; Vitl vitl1 = 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.SqlSaveAdderAndBack(vitl1); }
private void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { CoresEditAdder Detalis1 = new CoresEditAdder(); Detalis1.idVite = NameOfCouress.id; this.Opacity = 0.5; Detalis1.CouressEdit = CouressList[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value), CouressList)]; if (Detalis1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { CouressList[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value), CouressList)] = Detalis1.CouressEdit; if (ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value) > 0) { IntEditCoress.Add(ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value), CouressList)); } } ClassDataGridViewDo.DataGridEnterGridToWorkNameOfCouress_ta(dataGridViewX1, CouressList, VitlByIdList); this.Opacity = 1; } }
private async void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { AdderNameForTeam EditTame = new AdderNameForTeam(); this.Opacity = 0.5; EditTame.NameTeam = NameTeam; EditTame.Team = TeamList[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value), TeamList)]; if (EditTame.ShowDialog() == System.Windows.Forms.DialogResult.OK) { await Sqldatabasethrding.SqlSaveVitl(EditTame.Team.updata()); UpdateTheNewAdderOrEdit(); } this.Opacity = 1; } }
private void dataGridViewX3_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { ShowAllIteam ShowAllIteam1 = new ShowAllIteam(WereDeliveryList[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX3.Rows[e.RowIndex].Cells[0].Value), WereDeliveryList)]); ShowAllIteam1.idVite = idvite; this.Opacity = 0.5; if (ShowAllIteam1.ShowDialog() == System.Windows.Forms.DialogResult.Yes) { WereDeliveryList[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX3.Rows[e.RowIndex].Cells[0].Value), WereDeliveryList)] = ShowAllIteam1.Waredelivare; if (ClassConvert.Convint(dataGridViewX3.Rows[e.RowIndex].Cells[0].Value) > 0) { IntEditWere.Add(ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX3.Rows[e.RowIndex].Cells[0].Value), WereDeliveryList)); } needSeaving = true; } ClassDataGridViewDo.DataGridEnterGridToWorkWereDelivery(dataGridViewX3, WereDeliveryList); this.Opacity = 1; } }
private void dataGridViewX1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { EditTame Detalis1 = new EditTame(); Detalis1.idVite = idvite; this.Opacity = 0.5; Detalis1.TeamEdit = TeamList[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value), TeamList)]; if (Detalis1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { TeamList[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value), TeamList)] = Detalis1.TeamEdit; if (ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value) > 0) { IntEditTeam.Add(ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX1.Rows[e.RowIndex].Cells[0].Value), TeamList)); } needSeaving = true; } ClassDataGridViewDo.DataGridEnterGridToWorkTeam(dataGridViewX1, TeamList); this.Opacity = 1; } }
public CV_Info(int id) { // System.Data.SqlClient.SqlCommand SqlCommand = new System.Data.SqlClient.SqlCommand("SELECT [id] ,[FullName] ,[Notes] ,[NmuberOfArchev] ,[Id_Study] ,[Year_sutr],[Numberphone] ,[Date],[ID_TemaNeed] ,[Bit] ,[ToOutTeam] ,[ToOutDate] ,[Notesout] FROM [HR_SARC].[dbo].[CV_Info] where [Delete] =0 and id = @id"); SqlCommand.Parameters.AddWithValue("id", id); List <List <object> > Adw = (Sqldatabasethrding.GetSql(SqlCommand)).Result; if (Adw[0].Count != 0) { this.id = Convert.ToInt32(Adw[0][0]); this.FullName = Convert.ToString(Adw[0][1]); this.Notes = Convert.ToString(Adw[0][2]); this.NmuberOfArchev = Convert.ToInt32(Adw[0][3]); this.Id_Study = Convert.ToInt32(Adw[0][4]); this.Year_sutr = Convert.ToInt32(Adw[0][5]); this.Numberphone = Convert.ToInt32(Adw[0][6]); this.Date = ClassConvert.ConvDateTimeNull(Adw[0][7]); this.ID_TemaNeed = Convert.ToInt32(Adw[0][8]); this.Bit = Convert.ToBoolean(Adw[0][9]); this.ToOutTeam = ClassConvert.Convint(Adw[0][10]); this.ToOutDate = ClassConvert.ConvDateTimeNull(Adw[0][11]); this.Notesout = Convert.ToString(Adw[0][12]); } }
private void buttonX2_Click(object sender, EventArgs e) { progressBarX1.Maximum = dataGridViewX1.Rows.Count - 1; buttonX2.Enabled = false; dataGridViewX1.Enabled = false; foreach (DataColumn Column in Dat.Tables[0].Columns) { if (listStringNkname2.IndexOf(Column.ColumnName) != -1) { listStringNkname1.Add(listStringNkname2[listStringNkname2.IndexOf(Column.ColumnName)]); } } MessageBoxEx.Show("الرجاء الإنتظار ...."); // Task.Run(() => { if (!checkBox2.Checked) { for (int i = 0; i < dataGridViewX1.Rows.Count - 1; i++) { progressBarX1.BeginInvoke(new Prosser(NewProsserVaul), i); if (ClassConvert.Convint64(dataGridViewX1.Rows[i].Cells[listStringNkname2[4]].Value) > 0) { if (Vitl.GetIf(ClassConvert.Convint64(dataGridViewX1.Rows[i].Cells[listStringNkname2[4]].Value))) { SaveMyVitlNew(i); goto end; } else { goto end; } } if (Convert.ToString(dataGridViewX1.Rows[i].Cells[listStringNkname2[11]].Value) != "") { if (Vitl.GetIfEmail(Convert.ToString(dataGridViewX1.Rows[i].Cells[listStringNkname2[11]].Value))) { SaveMyVitlNew(i); goto end; } else { goto end; } } if (ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname2[14]].Value) != 0) { if (Vitl.GetIfmobilephon(ClassConvert.Convint(dataGridViewX1.Rows[i].Cells[listStringNkname2[11]].Value))) { SaveMyVitlNew(i); goto end; } else { goto end; } } SaveMyVitlNew(i); end :; } } else { for (int i = 0; i < dataGridViewX1.Rows.Count - 1; i++) { SaveMyVitlNew(i); } } // dataGridViewX1.Enabled = true; buttonX2.BeginInvoke(new buttn(Endbuttonx2)); // }); }
private void dataGridViewX3_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { Corser Corser = new Corser(); this.Opacity = 0.5; Corser.NameOfCouress = NameOfCouress.NameOfCouresslist[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX3.Rows[e.RowIndex].Cells[0].Value), NameOfCouress.NameOfCouresslist)]; Corser.ShowDialog(); this.Opacity = 1; } }
private void dataGridViewX9_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { TeamShowAll TeamShowAll = new TeamShowAll(); this.Opacity = 0.5; TeamShowAll.NameTeam = NameTeam.NameTeamStatic[ClassDataGridViewDo.RetunIndexByIdSech(ClassConvert.Convint(dataGridViewX9.Rows[e.RowIndex].Cells[0].Value), NameTeam.NameTeamStatic)]; TeamShowAll.ShowDialog(); this.Opacity = 1; } }
public async void ForRunThrading() { try { dataGridViewX1.Enabled = false; ClassDataGridViewDo.ClumChekArray(NameCol, dataGridViewX1); progressBarX1.Maximum = dataGridViewX1.Rows.Count; int IndexCombox = comboBoxEx1.SelectedIndex; Stopwatch stopwatch = new Stopwatch(); stopwatch.Start(); for (int i = 0; i < dataGridViewX1.Rows.Count; i++) { stopwatch.Restart(); // إيقاف العمل في خلفية التزامن if (!Workin) { break; } //العداد progressBarX1.Value = i; // إنتظار بين الأمر والثاني await System.Threading.Tasks.Task.Delay(100); int id = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["id"].Value); int NumberOfCoures = ClassConvert.Convint(dataGridViewX1.Rows[i].Cells["رقم الدورة"].Value); int? NuberOfDayes = ClassConvert.ConvintNull(dataGridViewX1.Rows[i].Cells["عدد الأيام"].Value); float?float1 = ClassConvert.ConvFloatNull(dataGridViewX1.Rows[i].Cells["النتيجة"].Value); //أختبار هل الدورة مسجل عند الشخص + أنه تأكد من وجود ID if (!await Couress.GetIsItHaveCouresByIdInformation(id, IndexCombox)) { if (id > 0 && NumberOfCoures > 0 && NuberOfDayes != null && float1 != null) { int IdTheNameOfcoures = NameOfCouress.SerchByListStaticRetId(TypeofCouress.TypeofCouressList[IndexCombox].id, NumberOfCoures); if (IdTheNameOfcoures == -1) { DevComponents.DotNetBar.MessageBoxEx.Show("رقم الدورة غير مضاف:" + NumberOfCoures); break; } Couress CouresNew = new Couress(0, IdTheNameOfcoures, id, (int)NuberOfDayes, (float)float1); 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.Yellow; } labelX2.Text = ((stopwatch.ElapsedMilliseconds * (dataGridViewX1.Rows.Count - i)) / 1000).ToString(); } } catch (NoColumnsException ex) { ErrorClass.SaveErrorFile(ex); MessageBox.Show(string.Format(" لا يوجد عامود {0} ", ex.Message)); } catch (Exception ex) { ErrorClass.SaveErrorFile(ex); } buttonX3.Enabled = true; Workin = false; 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); }
private async System.Threading.Tasks.Task SaveNewOrUpdate() { try { if (idvite == 0) { #region تسجيل متطوع جديد #region المتغيرات للكلاس المعلومات الأساسية int id = 0; string first_name = this.first_name.Text; string Last_name = this.Last_name.Text; string Father_name = this.Father_name.Text; string Mather_name = this.Mather_name.Text; Int64 natiol_id = ClassConvert.Convint64(this.natiol_id.Text); bool Gender = ClassConvert.ConvBool(this.Gender.SelectedIndex); string where_birth = this.where_birth.Text; DateTime data_barthday = ClassConvert.ConvDateTime(this.data_barthday.Value); string Hanei_whare = this.Hanei_whare.Text; string Hanei_whare1 = this.Hanei_whare1.Text; string adderas = this.adderas.Text; string e_mail = this.e_mail.Text; int Stutes_Jtma3 = this.Stutes_Jtma3.SelectedIndex; int Phone_Ground = ClassConvert.Convint(this.Phone_Ground.Text); int Phone_Mobile1 = ClassConvert.Convint(this.Phone_Mobile1.Text); int Phone_Mobile2 = ClassConvert.Convint(this.Phone_Mobile2.Text); string Facebook = this.Facebook.Text; int whatsApp = ClassConvert.Convint(this.whatsApp.Text); int viper = ClassConvert.Convint(this.viper.Text); string Twiter = (this.Twiter.Text); string study = this.study.Text; int yearstudy = this.yearstudy.SelectedIndex; int Id_course = ClassConvert.Convint(this.Id_course.Text); string Id_course_Ware = this.Id_course_Ware.Text; DateTime data_regs = ClassConvert.ConvDateTime(this.data_regs.Value); System.Drawing.Image Image_id_nationl1 = ClassConvert.ConvImage(this.Image_id_nationl1.Image); System.Drawing.Image Image_id_nationl2 = ClassConvert.ConvImage(this.Image_id_nationl2.Image); System.Drawing.Image image = ClassConvert.ConvImage(this.image.Image); System.Drawing.Image Image_font = ClassConvert.ConvImage(this.Image_font.Image); int bitd_id = this.bitd_id.SelectedIndex; string Nkname = this.Nkname.Text; string nameEnglish = this.nameEnglish.Text; int Z1 = this.Z1.SelectedIndex; int z2 = ClassConvert.Convint(this.z2.Text); int z3 = this.z3.SelectedIndex; System.Xml.XmlDataDocument XmlHobbies = null; vitl1 = 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.SqlSaveAdderAndBack(vitl1); idvite = vitl1.id;//تاكد من عمل الصحيح للبرنامج #endregion #region إضافة وتعديل الفرق EditTame.CountOfNew = 0; foreach (Team IdInfoAdder in TeamList) { IdInfoAdder.EdidInfoId(idvite); } await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(TeamList), IntAdderTeam, IntEditTeam, IntDeletTeam); #endregion #region إضافة وتعديل الدورات CoresEditAdder.CountOfNew = 0; foreach (Couress IdInfoAdder in CouressList) { IdInfoAdder.EdidInfoId(idvite); } await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(CouressList), IntAdderCoress, IntEditCoress, IntDeletCoress); #endregion #endregion } else { #region تعديلات العلومات العامة #region المتغيرات string first_name = this.first_name.Text; string Last_name = this.Last_name.Text; string Father_name = this.Father_name.Text; string Mather_name = this.Mather_name.Text; Int64 natiol_id = ClassConvert.Convint64(this.natiol_id.Text); bool Gender = ClassConvert.ConvBool(this.Gender.SelectedIndex); string where_birth = this.where_birth.Text; DateTime data_barthday = ClassConvert.ConvDateTime(this.data_barthday.Value); string Hanei_whare = this.Hanei_whare.Text; string Hanei_whare1 = this.Hanei_whare1.Text; string adderas = this.adderas.Text; string e_mail = this.e_mail.Text; int Stutes_Jtma3 = this.Stutes_Jtma3.SelectedIndex; int Phone_Ground = ClassConvert.Convint(this.Phone_Ground.Text); int Phone_Mobile1 = ClassConvert.Convint(this.Phone_Mobile1.Text); int Phone_Mobile2 = ClassConvert.Convint(this.Phone_Mobile2.Text); string Facebook = this.Facebook.Text; int whatsApp = ClassConvert.Convint(this.whatsApp.Text); int viper = ClassConvert.Convint(this.viper.Text); string Twiter = (this.Twiter.Text); string study = this.study.Text; int yearstudy = this.yearstudy.SelectedIndex; int Id_course = ClassConvert.Convint(this.Id_course.Text); string Id_course_Ware = this.Id_course_Ware.Text; DateTime data_regs = ClassConvert.ConvDateTime(this.data_regs.Value); System.Drawing.Image Image_id_nationl1 = ClassConvert.ConvImage(this.Image_id_nationl1.Image); System.Drawing.Image Image_id_nationl2 = ClassConvert.ConvImage(this.Image_id_nationl2.Image); System.Drawing.Image image = ClassConvert.ConvImage(this.image.Image); System.Drawing.Image Image_font = ClassConvert.ConvImage(this.Image_font.Image); int bitd_id = this.bitd_id.SelectedIndex; string Nkname = this.Nkname.Text; string nameEnglish = this.nameEnglish.Text; int Z1 = this.Z1.SelectedIndex; int z2 = ClassConvert.Convint(this.z2.Text); int z3 = this.z3.SelectedIndex; System.Xml.XmlDataDocument XmlHobbies = null; #endregion vitl1.UpdateOUtid(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); await Sqldatabasethrding.SqlupdataVitl(vitl1.updata()); #endregion #region إضافة وتعديل الفرق await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(TeamList), IntAdderTeam, IntEditTeam, IntDeletTeam); #endregion #region إضافة وتعديل الدورات await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(CouressList), IntAdderCoress, IntEditCoress, IntDeletCoress); #endregion #region إضافة وتعديل وحذف الأستلامات await Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(WereDeliveryList), IntAdderWere, IntEditWere, IntDeletWere); #endregion } /////Loed Team Grid EditTame.CountOfNew = 0; TeamList = await Team.GetByIdVil(idvite); ClassDataGridViewDo.DataGridEnterGridToWorkTeam(dataGridViewX1, TeamList); ////Loed Coures Grid CoresEditAdder.CountOfNew = 0; CouressList = Couress.GetByIdVil(idvite); ClassDataGridViewDo.DataGridEnterGridToWorkCorser(dataGridViewX2, CouressList); #region التقيم ValuationList = Valuation.GetByIdVil(idvite); ClassDataGridViewDo.DataGridEnterGridToWorkValuation(dataGridViewX4, ValuationList); #endregion MegBox.Show("تم التعديل", this); } catch (Exception xv) { MessageBox.Show(xv.ToString()); } }