Example #1
0
        public static async Task <bool> RetHaveVitelACtiv(int ID_informtion)
        {
            System.Data.SqlClient.SqlCommand Sqlcom = new System.Data.SqlClient.SqlCommand("SELECT [Id] FROM [HR_SARC].[dbo].[Team_ta] where [ID_informtion] = @ID_informtion and [Delete] = 0  and Date_End is null");
            Sqlcom.Parameters.AddWithValue("ID_informtion", ID_informtion);

            await Sqldatabasethrding.openConction();

            Sqlcom.Connection = Sqldatabasethrding.SqlConnection1;
            System.Data.SqlClient.SqlDataReader Rader = await Sqlcom.ExecuteReaderAsync();

            try
            {
                while (await Rader.ReadAsync())
                {
                    return(true);
                }
            }
            catch (Exception e)
            {
                ErrorClass.SaveErrorFile(e);
            }
            finally
            {
                Rader.Close();
            }

            return(false);
        }