Example #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);
            }
                                            );
        }
Example #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 = "";
            }
        }
Example #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("تم المعالجة");
        }
Example #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);
        }