示例#1
0
        public isitmaTip isitmaTipGetirId(int isTipId)
        {
            isitmaTip itp = new isitmaTip();

            try
            {
                SqlCommand com = new SqlCommand("select * from IsitmaTip where IsitmaTipId = @isitmaTipId", con);
                com.Parameters.AddWithValue("@isitmaTipId", isTipId);
                com.CommandType = CommandType.Text;

                con.Open();
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    itp.IsitmaTipAd = dr["IsitmaTipAd"].ToString();
                    itp.IsitmaTipId = Convert.ToInt32(dr["IsitmaTipId"]);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
            }
            finally
            {
                con.Close();
            }
            return(itp);
        }
示例#2
0
        public List <isitmaTip> isitmaTipGetirTum()
        {
            List <isitmaTip> isTipler = new List <isitmaTip>();

            try
            {
                SqlCommand com = new SqlCommand("select * from IsitmaTip  order by IsitmaTipAd", con);
                com.CommandType = CommandType.Text;

                con.Open();
                SqlDataReader dr = com.ExecuteReader();
                while (dr.Read())
                {
                    isitmaTip itp = new isitmaTip();
                    itp.IsitmaTipAd = dr["IsitmaTipAd"].ToString();
                    itp.IsitmaTipId = Convert.ToInt32(dr["IsitmaTipId"]);
                    isTipler.Add(itp);
                }
                dr.Close();
            }
            catch (Exception ex)
            {
            }
            finally
            {
                con.Close();
            }
            return(isTipler);
        }