Example #1
0
        private async void buttonItem3_Click(object sender, EventArgs e)
        {
            AdderCouresFor AdderCouresFor1 = new AdderCouresFor();

            if (AdderCouresFor1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                await Sqldatabasethrding.SqlSaveVitl(AdderCouresFor1.NameOfCouress1.adder());

                NameOfCouress.NameOfCouresslist = NameOfCouress.GetAll();
                ClassDataGridViewDo.DataGridEnterGridToWorkNameOfCouress_ta(dataGridViewX3, NameOfCouress.NameOfCouresslist);
            }
        }
Example #2
0
 private void buttonX1_Click(object sender, EventArgs e)
 {
     if (NameOfCouress1 == null)
     {
         NameOfCouress1 = new NameOfCouress(0, dateTimeInput1.Value, dateTimeInput2.Value, checkBoxX1.Checked, TypeofCouress.TypeofCouressList[comboBoxEx1.SelectedIndex].id, textBoxX1.Text, integerInput1.Value, comboBoxEx2.SelectedIndex);
     }
     else
     {
         NameOfCouress1.Edit(dateTimeInput1.Value, dateTimeInput2.Value, checkBoxX1.Checked, TypeofCouress.TypeofCouressList[comboBoxEx1.SelectedIndex].id, textBoxX1.Text, integerInput1.Value, comboBoxEx2.SelectedIndex);
     }
     this.DialogResult = System.Windows.Forms.DialogResult.OK;
 }
Example #3
0
        private async void buttonX4_Click(object sender, EventArgs e)
        {
            AdderCouresFor AdderCouresFor1 = new AdderCouresFor();

            AdderCouresFor1.NameOfCouress1 = NameOfCouress;
            if (AdderCouresFor1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                NameOfCouress = AdderCouresFor1.NameOfCouress1;
                await Sqldatabasethrding.SqlSaveVitl(AdderCouresFor1.NameOfCouress1.updata());

                textBoxX1.Text            = NameOfCouress.Decrption;
                comboBoxEx1.SelectedIndex = ClassDataGridViewDo.RetunIndexByIdSech(NameOfCouress.Id_TypeofCouress_ta, TypeofCouress.TypeofCouressList);
            }
        }
        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;
        }
Example #5
0
        private async void RibbonForm1_Load(object sender, EventArgs e)
        {
            #region setup1
            Vitl.SetUpNameDataBase();



            #endregion
            //      Sqldatabasethrding.SqlConnection1.ConnectionString = Sqldatabasethrding.sqlconction;
            //      Sqldatabasethrding.SqlConnection1.Open();


            #region SetUpCLassis
            CvTeamNeed.CvTeamNeedList = await CvTeamNeed.GetAll();

            CV_Study.CV_StudyList = await CV_Study.GetAll();

            NameTeamType.NameTeamTypeStatic = NameTeamType.GetAll();
            NameTeam.NameTeamStatic         = await NameTeam.GetAll();

            Jop.JopStatic = Jop.GetAll();

            TypeofCouress.TypeofCouressList = TypeofCouress.GetAll();
            NameOfCouress.NameOfCouresslist = NameOfCouress.GetAll();
            WereType.WereTypeList           = WereType.GetAll();
            Valuationname.Valuationnamelist = Valuationname.GetAll();

            Scileis.ScileislList = await Scileis.GetAll();


            Qustiones.Qustioneslist = Qustiones.GetAll();


            //من أجل عم بحث على أنهم غير فعالين
            Team.ListNotAllAtive.Add(4);
            Team.ListNotAllAtive.Add(5);
            //من أجل عم بحث على أنهم غير فعالين
            ////

            Team.Setwation.Add("رديف");
            Team.Setwation.Add("أساسي");
            Team.Setwation.Add("دوار");
            Team.Setwation.Add("موظف");
            Team.Setwation.Add("مسافر");
            Team.Setwation.Add("منقطع");
            Team.Setwation.Add("تطوعي غير مؤجور");
            ///
            Valuationname.ValuationnameTypeInt.Add("دائمين");
            Valuationname.ValuationnameTypeInt.Add("تجربين");
            Valuationname.ValuationnameTypeInt.Add("شامل لكل المتطوعين");
            Valuationname.ValuationnameTypeInt.Add("مخصص");
            //
            Vitl.Bransh.Add("حلب");
            Vitl.Bransh.Add("حلب-سفيرة");
            //
            #endregion

            #region interFace

            ClassDataGridViewDo.DataGridAddVuleComBoxEx((DataGridViewComboBoxExColumn)dataGridViewX3.Columns["Id_TypeofCouress_ta"], TypeofCouress.TypeofCouressList);
            ClassDataGridViewDo.DataGridAddVuleComBoxEx((DataGridViewComboBoxExColumn)dataGridViewX9.Columns["NameTeamType_Id"], NameTeamType.NameTeamTypeStatic);
            ClassDataGridViewDo.DataGridEnterGridToWorkNameOfCouress_ta(dataGridViewX3, NameOfCouress.NameOfCouresslist);
            //dataGridViewX9
            ClassDataGridViewDo.DataGridEnterGridToWorkNameTeam_Ta(dataGridViewX9, NameTeam.NameTeamStatic);
            await Sqldatabasethrding.GetNameForRibbonForm1Combox(intList);

            #endregion
            comboBoxEx1.AutoCompleteCustomSource = Combox;
        }