public static List <Couress> GetByIdVil(int id, bool JustSecscc = false) { List <Couress> Lista = new List <Couress>(); System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand("SELECT [Id],[id_NameOfCouress],[Id_Information],[NumberOfdayregest],[Result] FROM [HR_SARC].[dbo].[Couress_ta] where Id_Information = @id and [Delete] = 0"); if (JustSecscc) { SqlComm.CommandText += " and [Result] >= @RetultSect"; SqlComm.Parameters.AddWithValue("RetultSect", RetultSect); } SqlComm.Parameters.AddWithValue("@id", id); 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 Couress(Convert.ToInt32(Adw[i][0]), Convert.ToInt32(Adw[i][1]), Convert.ToInt32(Adw[i][2]), Convert.ToInt32(Adw[i][3]), Convert.ToSingle(Adw[i][4]))); } } return(Lista); }
public static async System.Threading.Tasks.Task <int> Serch(string ByIdArchev) { ByIdArchev = ClassDataGridViewDo.Trimall(ByIdArchev); System.Data.SqlClient.SqlCommand Sqlcom = new System.Data.SqlClient.SqlCommand(""); Sqlcom.CommandText = "SELECT [HR_SARC]. dbo.CV_Info.id , [HR_SARC].dbo.CV_Info.NmuberOfArchev , [HR_SARC]. dbo.CV_Study.Sampl FROM [HR_SARC].dbo.CV_Info INNER JOIN [HR_SARC].dbo.CV_Study on [HR_SARC].[dbo].CV_Info.Id_Study = [HR_SARC].[dbo].CV_Study.id WHERE [HR_SARC].dbo.CV_Study.Sampl + CAST( [HR_SARC].dbo.CV_Info.NmuberOfArchev as nvarchar) like @ByIdArchev "; Sqlcom.Parameters.AddWithValue("@ByIdArchev", ByIdArchev); List <CV_Info> Ve = new List <CV_Info>(); List <List <object> > Ob = await Sqldatabasethrding.GetSql(Sqlcom); for (int i = 0; i < Ob.Count; i++) { if (Ob[i].Count != 0) { try { return(Convert.ToInt32(Ob[i][0])); } catch (Exception e) { ErrorClass.SaveErrorFile(e); } } } return(-1); }
public static List <Team> GetByGetbyIdNameName(int id, bool Ative) { List <Team> Lista = new List <Team>(); string sqlCommand = "SELECT [Id],[date_Start] ,[Date_End],[ID_informtion],[id_NameTeam_Ta],[Id_Jop_Ta] ,[Setewation],[Delete] FROM [HR_SARC].[dbo].[Team_ta] where [Delete] = 0 and [id_NameTeam_Ta] = @id "; if (Ative) { sqlCommand += " And ( [Date_End] is null ) "; for (int i = 0; i < Team.ListNotAllAtive.Count; i++) { sqlCommand += " And [Setewation] !=" + Team.ListNotAllAtive[i].ToString(); } } System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand(sqlCommand); SqlComm.Parameters.AddWithValue("@id", id); 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 Team(Convert.ToInt32(Adw[i][0]), ClassConvert.ConvDateTimeNull(Adw[i][1]), ClassConvert.ConvDateTimeNull(Adw[i][2]), Convert.ToInt32(Adw[i][3]), Convert.ToInt32(Adw[i][4]), Convert.ToInt32(Adw[i][5]), Convert.ToInt32(Adw[i][6]))); } } return(Lista); }
private async void buttonX1_Click(object sender, EventArgs e) { System.Data.SqlClient.SqlCommand fe = new System.Data.SqlClient.SqlCommand(" SELECT [HR_SARC].[dbo].[Information_Ta].[Id] ,[HR_SARC].[dbo].[Information_Ta].[first_name]+ N' '+ [HR_SARC].[dbo].[Information_Ta].[Last_name] as fullname , study , yearstudy,data_regs FROM [HR_SARC].[dbo].[Information_Ta] where [HR_SARC].[dbo].[Information_Ta].study like @study and [Delete] = 0 "); System.Data.SqlClient.SqlCommand fce = new System.Data.SqlClient.SqlCommand(" SELECT [HR_SARC].[dbo].[Information_Ta].[Id] FROM [HR_SARC].[dbo].[Information_Ta] INNER JOIN [HR_SARC].[dbo].[Couress_ta] ON [HR_SARC].[dbo].[Information_Ta].[Id] = [HR_SARC].[dbo].[Couress_ta].[Id_Information] where [HR_SARC].[dbo].[Couress_ta].[id_NameOfCouress] = 1003 and [HR_SARC].[dbo].[Information_Ta].[Delete] = 0 "); string stringx = ClassDataGridViewDo.LograthemChangEverAleffToAll("تصاد", true); fce.Parameters.AddWithValue("@study", "%" + stringx + "%"); fe.Parameters.AddWithValue("@study", "%" + stringx + "%"); List <List <object> > ef = await Sqldatabasethrding.GetSql(fe); List <List <object> > ef1 = await Sqldatabasethrding.GetSql(fce); for (int i = 0; i < ef.Count; i++) { dataGridViewX1.Rows.Add(ef[i][0].ToString(), ef[i][1].ToString(), ef[i][2].ToString(), ef[i][3].ToString(), "", Convert.ToDateTime(ef[i][4]).ToShortDateString(), Convert.ToDateTime(ef[i][4]).ToLongDateString()); } for (int i = 0; i < ef1.Count; i++) { for (int j = 0; j < dataGridViewX1.Rows.Count; j++) { if (ef1[i][0].ToString() == dataGridViewX1.Rows[j].Cells[0].Value.ToString()) { dataGridViewX1.Rows[j].Cells[4].Value = "كوارث"; break; } } } }
public async static Task <int> CV_studyID(string W) { System.Data.SqlClient.SqlCommand sql = new System.Data.SqlClient.SqlCommand("SELECT [id] FROM [HR_SARC].[dbo].[CV_Study] where sampl = @sampl "); sql.Parameters.AddWithValue("sampl", W); List <List <object> > Sqlb = await Sqldatabasethrding.GetSql(sql); if (Sqlb.Count != 0) { return(Convert.ToInt32(Sqlb[0][0])); } else { return(NumberOfIdNotReg); } }
public async static System.Threading.Tasks.Task <int> GetTheNumberArchev(int IdStudy) { //SELECT [NmuberOfArchev] FROM [HR_SARC].[dbo].[CV_Info] where [id_study] = @id_study ORDER BY id DESC System.Data.SqlClient.SqlCommand Sql = new System.Data.SqlClient.SqlCommand("SELECT top 1 [NmuberOfArchev] FROM [HR_SARC].[dbo].[CV_Info] where [id_study] = @id_study ORDER BY NmuberOfArchev DESC"); Sql.Parameters.AddWithValue("id_study", IdStudy); List <List <object> > Op = await Sqldatabasethrding.GetSql(Sql); if (Op.Count != 0) { return(Convert.ToInt32(Op[0][0]) + 1); } else { return(1); } }
public async static Task <List <CvTeamNeed> > GetAll() { List <CvTeamNeed> Lista = new List <CvTeamNeed>(); List <List <object> > Adw = await Sqldatabasethrding.GetSql(new System.Data.SqlClient.SqlCommand("SELECT [id] ,[FullName] FROM [HR_SARC].[dbo].[CvTeamNeed] where [Delete] = 0")); for (int i = 0; i < Adw.Count; i++) { if (Adw[i].Count != 0) { Lista.Add(new CvTeamNeed(Convert.ToInt32(Adw[i][0]), Convert.ToString(Adw[i][1]))); } } return(Lista); }
/// <summary> /// جلب جميع الأسماء /// </summary> /// <returns></returns> public async static Task <List <NameTeam> > GetAll() { List <NameTeam> Lista = new List <NameTeam>(); List <List <object> > Adw = await Sqldatabasethrding.GetSql(new System.Data.SqlClient.SqlCommand("SELECT [Id],[nameOftame],[NameTeamType_Id] FROM [HR_SARC].[dbo].[NameTeam_Ta] where [Delete] = 0")); for (int i = 0; i < Adw.Count; i++) { if (Adw[i].Count != 0) { Lista.Add(new NameTeam(Convert.ToInt32(Adw[i][0]), Convert.ToString(Adw[i][1]), Convert.ToInt32(Adw[i][2]))); } } return(Lista); }
public async static System.Threading.Tasks.Task <bool> GetHAVECVSELC(int CV_Info_ID, int Scileis_ID) { System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand("SELECT [id] FROM [HR_SARC].[dbo].[HaveScil] where [Delete] = 0 and CV_Info_ID = @CV_Info_ID and Scileis_ID =@Scileis_ID"); SqlComm.Parameters.AddWithValue("@CV_Info_ID", CV_Info_ID); SqlComm.Parameters.AddWithValue("@Scileis_ID", Scileis_ID); List <List <object> > Adw = await Sqldatabasethrding.GetSql(SqlComm); for (int i = 0; i < Adw.Count; i++) { if (Adw[i].Count != 0) { return(true); } } return(false); }
public async static System.Threading.Tasks.Task <List <HaveScil> > GetByidInfoCV(int CV_Info_ID) { List <HaveScil> Lista = new List <HaveScil>(); System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand("SELECT [id],[Scileis_ID],[CV_Info_ID],[Star] FROM [dbo].[HaveScil] where [Delete] = 0 and CV_Info_ID = @CV_Info_ID"); SqlComm.Parameters.AddWithValue("@CV_Info_ID", CV_Info_ID); List <List <object> > Adw = await Sqldatabasethrding.GetSql(SqlComm); for (int i = 0; i < Adw.Count; i++) { if (Adw[i].Count != 0) { Lista.Add(new HaveScil(Convert.ToInt32(Adw[i][0]), Convert.ToInt32(Adw[i][1]), Convert.ToInt32(Adw[i][2]), Convert.ToInt32(Adw[i][3]))); } } return(Lista); }
public static List <ValuationForm> GetAllbyIdValuationname(int id) { List <ValuationForm> Lista = new List <ValuationForm>(); Task <List <List <object> > > temp = Sqldatabasethrding.GetSql(new System.Data.SqlClient.SqlCommand("SELECT [id],[id_Valuationname_Ta],[id_qustion] ,[mark] ,[Delete] FROM [HR_SARC].[dbo].[ValuationForm] where [Delete] = 0 and [id_Valuationname_Ta] = " + id.ToString())); 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 ValuationForm(Convert.ToInt32(Adw[i][0]), Convert.ToInt32(Adw[i][1]), Convert.ToInt32(Adw[i][2]), Convert.ToInt32(Adw[i][3]))); } } return(Lista); }
public static List <Valuation> GetByIdVil(int idinformation) { List <Valuation> Lista = new List <Valuation>(); Task <List <List <object> > > temp = Sqldatabasethrding.GetSql(new System.Data.SqlClient.SqlCommand("SELECT [id] ,[Id_Information] ,[Id_Information_Write] ,[id_ValuationForm] ,[XmlResult] ,[DateSave] FROM [HR_SARC].[dbo].[Valuation_ta] where [Id_Information] = " + idinformation.ToString())); 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 Valuation(Convert.ToInt32(Adw[i][0]), Convert.ToInt32(Adw[i][1]), Convert.ToString(Adw[i][2]), Convert.ToInt32(Adw[i][3]), XDocument.Parse(Adw[i][4].ToString()), Convert.ToDateTime(Adw[i][5]))); } } return(Lista); }
/// <summary> /// أرجع جميع الأعامل /// </summary> /// <returns></returns> public static List <Jop> GetAll() { List <Jop> Lista = new List <Jop>(); Task <List <List <object> > > temp = Sqldatabasethrding.GetSql(new System.Data.SqlClient.SqlCommand("SELECT [Id] ,[NvacherWord],[NvacherWordEng] ,[Sex] ,[Delete] FROM [HR_SARC].[dbo].[Jop_Ta] where [Delete] = 0")); 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 Jop(Convert.ToInt32(Adw[i][0]), Convert.ToString(Adw[i][1]), Convert.ToString(Adw[i][2]), Convert.ToBoolean(Adw[i][3]))); } } return(Lista); }
public static List <NameTeamType> GetAll() { List <NameTeamType> Lista = new List <NameTeamType> ( ); Task <List <List <object> > > temp = Sqldatabasethrding.GetSql(new System.Data.SqlClient.SqlCommand("SELECT [Id],[TypeOfTeam] FROM [HR_SARC].[dbo].[NameTeamType_Ta] where [Delete] = 0")); 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 NameTeamType(Convert.ToInt32(Adw[i][0]), Convert.ToString(Adw[i][1]))); } } return(Lista); }
public static List <NameOfCouress> GetAll() { List <NameOfCouress> Lista = new List <NameOfCouress>(); System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand("SELECT [Id],[dataStart],[DataENd],[Suport],[Id_TypeofCouress_ta] ,[Decrption] ,[IntCoures] , WhereIS FROM [HR_SARC].[dbo].[NameOfCouress_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 NameOfCouress(Convert.ToInt32(Adw[i][0]), ClassConvert.ConvDateTime(Adw[i][1]), ClassConvert.ConvDateTime(Adw[i][2]), ClassConvert.ConvBool(Adw[i][3]), Convert.ToInt32(Adw[i][4]), Convert.ToString(Adw[i][5]), Convert.ToInt32(Adw[i][6]), Convert.ToInt32(Adw[i][7]))); } } return(Lista); }
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); }
public async static Task <List <Team> > GetByIdVil(int id, bool Activet = false) { List <Team> Lista = new List <Team>(); System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand("SELECT [Id],[date_Start] ,[Date_End],[ID_informtion],[id_NameTeam_Ta],[Id_Jop_Ta] ,[Setewation],[Delete] FROM [HR_SARC].[dbo].[Team_ta] where [Delete] = 0 and [ID_informtion] = @id "); if (Activet) { SqlComm.CommandText += " And ( [Date_End] is null ) "; } SqlComm.Parameters.AddWithValue("@id", id); List <List <object> > Adw = await Sqldatabasethrding.GetSql(SqlComm); for (int i = 0; i < Adw.Count; i++) { if (Adw[i].Count != 0) { Lista.Add(new Team(Convert.ToInt32(Adw[i][0]), ClassConvert.ConvDateTimeNull(Adw[i][1]), ClassConvert.ConvDateTimeNull(Adw[i][2]), Convert.ToInt32(Adw[i][3]), Convert.ToInt32(Adw[i][4]), Convert.ToInt32(Adw[i][5]), Convert.ToInt32(Adw[i][6]))); } } return(Lista); }
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]); } }
public static List <WereDelivery> GetByIdVil(int id) { List <WereDelivery> Lista = new List <WereDelivery>(); System.Data.SqlClient.SqlCommand SqlComm = new System.Data.SqlClient.SqlCommand("select [id],[Id_WereType] ,[dateDeliveryitem] ,[id_Information],[DateBackitem],[Notes] FROM [HR_SARC].[dbo].[WereDelivery_ta] where [id_Information] = @id and [Delete] = 0"); SqlComm.Parameters.AddWithValue("@id", id); 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 WereDelivery(Convert.ToInt32(Adw[i][0]), Convert.ToInt32(Adw[i][1]), ClassConvert.ConvDateTimeNull(Adw[i][2]), Convert.ToInt32(Adw[i][3]), ClassConvert.ConvDateTimeNull(Adw[i][4]), Convert.ToString(Adw[i][5]))); } } return(Lista); }
/// <summary> /// من أجل البحث المتقم /// </summary> /// <param name="Stringa">الأسم</param> /// <param name="SerchAdvaCoursClass">كلاس البحث المتقدم</param> /// <param name="idJop">مصفوفة المناصب</param> /// <param name="IdTeam">مصفوفة الفرق</param> /// <param name="ActivVitel">هل المتطوع فعال</param> /// <param name="InformationSelect"></param> /// <param name="SqlCmaand"></param> /// <param name="DataGridViewX1"></param> /// <param name="DateFrom"></param> /// <param name="DateEnd"></param> /// <returns></returns> public static async Task WaitSqlsersh(string Stringa, SerchAdvaCoursClass SerchAdvaCoursClass, List <int> idJop, List <int> IdTeam, bool ActivVitel, string InformationSelect, SqlCommand SqlCmaand, DevComponents.DotNetBar.Controls.DataGridViewX DataGridViewX1, DateTime DateFrom, DateTime DateEnd) { await openConction(); SqlCommand sqlcom1 = null; sqlcom1 = Vitl.SerchRetIdInformation(Stringa, InformationSelect, SqlCmaand, DateFrom, DateEnd); sqlcom1.Connection = SqlConnection1; IAsyncResult result = sqlcom1.BeginExecuteReader(); SqlDataReader reader = sqlcom1.EndExecuteReader(result); DataGridViewX1.Rows.Clear(); List <IDinformationAdvSrchFullCoures> IDinformationAdvSrchListProsses = new List <IDinformationAdvSrchFullCoures>(); try { int NumberDub = reader.FieldCount; while (await reader.ReadAsync()) { IDinformationAdvSrchListProsses.Add(new IDinformationAdvSrchFullCoures(reader.GetInt32(0))); } } catch (Exception e) { MessageBox.Show(e.ToString()); } finally { reader.Close(); } ///هاد من شان البحث هل المتطوع لديه هذا المنصب for (int i = 0; i < idJop.Count; i++) { for (int j = 0; j < IDinformationAdvSrchListProsses.Count; j++) { if (await Team.RetHaveVitelJop(IDinformationAdvSrchListProsses[j].idinformation, idJop[i])) { IDinformationAdvSrchListProsses[j].AddJop(idJop[i]); } } } // هاد من أجل البحث هل المتطوع لديه الدوره for (int i = 0; i < SerchAdvaCoursClass.idTypeofcorsSerch.Count; i++) { for (int j = 0; j < IDinformationAdvSrchListProsses.Count; j++) { if (await Couress.GetIsItHaveCouresByIdInformation(IDinformationAdvSrchListProsses[j].idinformation, SerchAdvaCoursClass.idTypeofcorsSerch[i], true, !SerchAdvaCoursClass.idTypeofcorsSerchbool[i])) { IDinformationAdvSrchListProsses[j].AddCoures(SerchAdvaCoursClass.idTypeofcorsSerch[i]); } } } //هل هذا المتطوع في الفريق for (int i = 0; i < IdTeam.Count; i++) { for (int j = 0; j < IDinformationAdvSrchListProsses.Count; j++) { if (await Team.RetHaveVitelTeam(IDinformationAdvSrchListProsses[j].idinformation, IdTeam[i])) { IDinformationAdvSrchListProsses[j].AddTeam(IdTeam[i]); } } } ///من أجل المتطوعين الفعالين if (ActivVitel) { for (int j = 0; j < IDinformationAdvSrchListProsses.Count; j++) { if (await Team.RetHaveVitelACtiv(IDinformationAdvSrchListProsses[j].idinformation)) { IDinformationAdvSrchListProsses[j].SetAtciv(); } } } List <IDinformationAdvSrchFullCoures> IDView = await IDinformationAdvSrchFullCoures.GetHaveAll(SerchAdvaCoursClass.idTypeofcorsSerch, idJop, IdTeam, ActivVitel, IDinformationAdvSrchListProsses); List <List <object> > obj = new List <List <object> > (); obj = await Sqldatabasethrding.GetSql(Vitl.Serhid(IDView)); foreach (List <object> item in obj) { int i = 0; DataGridViewX1.Rows.Add(item[i].ToString(), item[++i].ToString(), item[++i].ToString(), item[++i].ToString(), item[++i].ToString(), item[++i].ToString(), item[++i].ToString(), item[++i].ToString()); } }
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); }