示例#1
0
        private async System.Threading.Tasks.Task Serch()
        {
            int NumberPhones = 0;

            try
            {
                NumberPhones = Convert.ToInt32(textBoxX2.Text);
            }
            catch { }
            List <CV_Info> CvList = await CV_Info.Serch(textBox1.Text, textBox2.Text, comboBox1.SelectedIndex != -1?CV_Study.CV_StudyList[comboBox1.SelectedIndex].id : -1, comboBox2.SelectedIndex, comboBox3.SelectedIndex != -1?CvTeamNeed.CvTeamNeedList[comboBox3.SelectedIndex].id : -1, checkBoxX1.Checked, NumberPhones, textBoxX1.Text, comboBoxEx1.SelectedIndex != -1?CvTeamNeed.CvTeamNeedList[comboBoxEx1.SelectedIndex].id : -1, textBoxX3.Text);

            List <CV_Info> CvListAfter = new  List <CV_Info>();

            if (comboBoxEx2.SelectedIndex != -1)
            {
                for (int i = 0; i < CvList.Count; i++)
                {
                    if (await HaveScil.GetHAVECVSELC(CvList[i].id, Scileis.ScileislList[comboBoxEx2.SelectedIndex].id))
                    {
                        CvListAfter.Add(CvList[i]);
                    }
                }
            }
            else
            {
                CvListAfter = CvList;
            }
            System.Threading.Tasks.Task.Run(() =>
            {
                ClassDataGridViewDo.DataGridEnterGridForCV_InfoCV(dataGridViewX1, CvListAfter);
            }
                                            );
        }
示例#2
0
        private async void Adder()
        {
            if (textBoxX1.Text != "")
            {
                int idw = Convert.ToInt32(await CV_Info.Serch(textBoxX1.Text));
                if (idw != -1)
                {
                    dataGridViewX1.Rows.Add(textBoxX1.Text);
                }

                textBoxX1.Text = "";
            }
        }
示例#3
0
        private async void buttonX2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dataGridViewX1.Rows.Count; i++)
            {
                int idw = Convert.ToInt32(await CV_Info.Serch((dataGridViewX1.Rows[i].Cells[0].Value).ToString()));
                if (idw != -1)
                {
                    CV_Info iNfo = new CV_Info(idw);

                    await iNfo.UpdateForGetTheCV(-1, null, "");
                }

                //    MessageBox.Show( (await CV_Info.Serch(textBoxX1.Text)).ToString());
            }
            MegBox.Show("تم المعالجة");
        }
        private async void buttonX2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i < dataGridViewX1.Rows.Count; i++)
            {
                int idw = Convert.ToInt32(await CV_Info.Serch((dataGridViewX1.Rows[i].Cells[0].Value).ToString()));
                if (idw != -1)
                {
                    CV_Info iNfo = new CV_Info(idw);

                    await iNfo.UpdateForGetTheCV(CvTeamNeed.CvTeamNeedList[comboBoxEx1.SelectedIndex].id, dateTimeInput1.Value, textBoxX2.Text);
                }

                //    MessageBox.Show( (await CV_Info.Serch(textBoxX1.Text)).ToString());
            }
            MegBox.Show("تم المعالجة");
        }
示例#5
0
        public static async System.Threading.Tasks.Task <List <CV_Info> > Serch(string Fullname, string Notes, int Id_Study, int Year_sutr, int ID_TemaNeed, bool Chek, int NumberPhone, string CodeForCV, int SelectTeamOut, string NotesOut)
        {
            String         Where = "";
            List <CV_Info> Ve    = new List <CV_Info>();

            Fullname = ClassDataGridViewDo.LograthemChangEverAleffToAll(Fullname, true);



            System.Data.SqlClient.SqlCommand Sqlcom = new System.Data.SqlClient.SqlCommand("SELECT  [id]  ,[FullName] ,[Notes]  ,[NmuberOfArchev]  ,[Id_Study] ,[Year_sutr],[Numberphone]  ,[Date],[ID_TemaNeed] ,[Bit] ,[ToOutTeam] , [ToOutDate] , [Notesout],[Delete]  FROM [HR_SARC].[dbo].[CV_Info] where [Delete] =0 and [FullName] = @FullName  " + Where);
            if (Notes.Trim() != "")
            {
                Where += " and [Notes] like @Notes";
                Sqlcom.Parameters.AddWithValue("@Notes", "%" + ClassDataGridViewDo.LograthemChangEverAleffToAll(Notes) + "%");
            }

            if (Id_Study != -1)
            {
                Where += " and [Id_Study] = @Id_Study";
                Sqlcom.Parameters.AddWithValue("Id_Study", Id_Study);
            }
            if (Year_sutr != -1)
            {
                Where += " and [Year_sutr] = @Year_sutr";
                Sqlcom.Parameters.AddWithValue("Year_sutr", Year_sutr);
            }
            if (ID_TemaNeed != -1)
            {
                Where += " and [ID_TemaNeed] = @ID_TemaNeed";
                Sqlcom.Parameters.AddWithValue("ID_TemaNeed", ID_TemaNeed);
            }
            if (Chek)
            {
                Where += " and [Bit] = @Bit";
                Sqlcom.Parameters.AddWithValue("Bit", !Chek);
            }
            if (NumberPhone != 0)
            {
                Where += " and [Numberphone] = @Numberphone";
                Sqlcom.Parameters.AddWithValue("Numberphone", NumberPhone);
            }
            if (SelectTeamOut != -1)
            {
                Where += " and [ToOutTeam] = @ToOutTeam";
                Sqlcom.Parameters.AddWithValue("ToOutTeam", SelectTeamOut);
            }
            if (NotesOut.Trim() != "")
            {
                Where += " and [Notesout] like @Notesout";
                Sqlcom.Parameters.AddWithValue("Notesout", "%" + ClassDataGridViewDo.LograthemChangEverAleffToAll(NotesOut, true) + "%");
            }


            Sqlcom.CommandText = "SELECT  [id]  ,[FullName] ,[Notes]  ,[NmuberOfArchev]  ,[Id_Study] ,[Year_sutr],[Numberphone]  ,[Date],[ID_TemaNeed] ,[Bit] ,[ToOutTeam] , [ToOutDate] , [Notesout],[Delete]  FROM [HR_SARC].[dbo].[CV_Info] where [Delete] =0 and [FullName] like @FullName  " + Where;
            Sqlcom.Parameters.AddWithValue("@FullName", "%" + Fullname + "%");

            if (CodeForCV != "")
            {
                Sqlcom.CommandText = "SELECT  [id]  ,[FullName] ,[Notes]  ,[NmuberOfArchev]  ,[Id_Study] ,[Year_sutr],[Numberphone]  ,[Date],[ID_TemaNeed] ,[Bit] ,[ToOutTeam] , [ToOutDate] , [Notesout],[Delete]  FROM [HR_SARC].[dbo].[CV_Info] where [Delete] =0 and [id] = @id  ";
                Sqlcom.Parameters.AddWithValue("id", await CV_Info.Serch(CodeForCV));
            }


            List <List <object> > Ob = await Sqldatabasethrding.GetSql(Sqlcom);

            for (int i = 0; i < Ob.Count; i++)
            {
                if (Ob[i].Count != 0)
                {
                    try
                    {
                        Ve.Add(new CV_Info(
                                   Convert.ToInt32(Ob[i][0]),
                                   Convert.ToString(Ob[i][1]),
                                   Convert.ToString(Ob[i][2]),
                                   Convert.ToInt32(Ob[i][3]),
                                   Convert.ToInt32(Ob[i][4]),
                                   Convert.ToInt32(Ob[i][5]),
                                   Convert.ToInt32(Ob[i][6]),
                                   ClassConvert.ConvDateTimeNull(Ob[i][7]),
                                   Convert.ToInt32(Ob[i][8]),
                                   Convert.ToBoolean(Ob[i][9]),
                                   -1,
                                   null,
                                   null
                                   ));
                    }
                    catch (Exception e)
                    {
                        ErrorClass.SaveErrorFile(e);
                    }
                }
            }

            return(Ve);
        }
示例#6
0
        private async void buttonX1_Click(object sender, EventArgs e)
        {
            DateTime?DateTimenull = ClassConvert.ConvDateTimeNull(dateTimeInput1.Value);

            if (CV_i == null)
            {
                if (comboBoxEx1.SelectedIndex == -1)
                {
                    MegBox.Show("لا يمكن ترك حقل دراسه فارغ");
                    return;
                }
                else if (textBoxX1.Text.Trim() == "")
                {
                    MegBox.Show("لا يمكن ترك حقل الأسم فارغ");
                    return;
                }
                else if (integerInput1.Value == 0)
                {
                    MegBox.Show("لا يمكن ترك حقل رقم الهاتف فارغ");
                    return;
                }
                else if (!ClassConvert.IsNumberPhoneMobileOrGrund(integerInput1.Value))
                {
                    MegBox.Show("لا يمكن ترك حقل رقم الهاتف فارغ");
                    return;
                }



                int Idc = CV_Study.CV_StudyList[comboBoxEx1.SelectedIndex].id;

                int Idc1 = -1;
                int Idc2 = -1;
                if (comboBoxEx3.SelectedIndex != -1)
                {
                    Idc1 = CvTeamNeed.CvTeamNeedList[comboBoxEx3.SelectedIndex].id;
                }

                if (comboBoxEx4.SelectedIndex != -1)
                {
                    Idc2 = CvTeamNeed.CvTeamNeedList[comboBoxEx4.SelectedIndex].id;
                }

                CV_i = new CV_Info(0, textBoxX1.Text, textBoxX2.Text, await CV.GetTheNumberArchev(Idc), Idc, comboBoxEx2.SelectedIndex, integerInput1.Value, dateTimeInput1.Value, Idc1, checkBoxX1.Checked, comboBoxEx4.SelectedIndex, ClassConvert.ConvDateTimeNull(dateTimeInput2.Value), textBoxX3.Text);
                int idc = await Sqldatabasethrding.SqlSaveAdderAndBack(CV_i.adder());

                if (idc > 0)
                {
                    MegBox.Show("تم التسجيل", this);
                    labelX4.Text = CV_i.GetCodeArch();
                    CV_i         = new CV_Info(idc, textBoxX1.Text, textBoxX2.Text, await CV.GetTheNumberArchev(Idc), Idc, comboBoxEx2.SelectedIndex, integerInput1.Value, dateTimeInput1.Value, Idc1, checkBoxX1.Checked, Idc2, ClassConvert.ConvDateTimeNull(dateTimeInput2.Value), textBoxX3.Text);
                    foreach (HaveScil item in listHavescil)
                    {
                        item.EditCV_Info_ID(CV_i.id);
                    }
                    Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(this.listHavescil), IntAddeHavescilr, InteditHavescil, IntDelHavescil);
                }
                else
                {
                    MegBox.Show("هناك خطأ في الاتصال", this);
                }
            }
            else
            {
                CV_i = new CV_Info(CV_i.id, textBoxX1.Text, textBoxX2.Text, (CV_i.Id_Study == CV_Study.CV_StudyList[comboBoxEx1.SelectedIndex].id ? CV_i.NmuberOfArchev: await CV.GetTheNumberArchev(CV_Study.CV_StudyList[comboBoxEx1.SelectedIndex].id)),
                                   CV_Study.CV_StudyList[comboBoxEx1.SelectedIndex].id,
                                   comboBoxEx2.SelectedIndex,
                                   integerInput1.Value,
                                   DateTimenull,
                                   comboBoxEx3.SelectedIndex != -1 ?    CvTeamNeed.CvTeamNeedList[comboBoxEx3.SelectedIndex].id : -1,
                                   checkBoxX1.Checked,
                                   comboBoxEx4.SelectedIndex != -1 ? CvTeamNeed.CvTeamNeedList[comboBoxEx4.SelectedIndex].id : -1, ClassConvert.ConvDateTimeNull(dateTimeInput2.Value), textBoxX3.Text
                                   );
                if (await Sqldatabasethrding.SqlSaveVitl(CV_i.updata()))
                {
                    labelX4.Text = CV_i.GetCodeArch();
                    MegBox.Show("تم التعديل", this);
                    Sqldatabasethrding.SqlAddOrUpdateOrDelet(ClassConvert.ConvertListInterfaseToDataBase(this.listHavescil), IntAddeHavescilr, InteditHavescil, IntDelHavescil);
                }
                else
                {
                    MegBox.Show("هناك خطأ في الاتصال", this);
                }
            }
        }
示例#7
0
 public CvAdder(CV_Info CV_i = null)
 {
     InitializeComponent();
     this.CV_i = CV_i;
 }