public static EKATEGORI Select(int _ID) { EKATEGORI item = null; try { SqlCommand com = new SqlCommand("KATEGORI_Select", Baglanti.Con); com.CommandType = CommandType.StoredProcedure; if (com.Connection.State != ConnectionState.Open) { com.Connection.Open(); } com.Parameters.AddWithValue("ID", _ID); SqlDataReader rdr = com.ExecuteReader(); if (rdr.HasRows) { while (rdr.Read()) { item.ID = int.Parse(rdr["ID"].ToString()); item.ADI = rdr["ADI"].ToString(); } } } catch (Exception) { item = null; } return(item); }
public static List <EKATEGORI> get_SubCatIdFonk(EKATEGORI item, int CatID) { List <EKATEGORI> liste = null; try { SqlCommand com = new SqlCommand("sayfalama_kategoriID", FCONNECTION.conn); com.CommandType = CommandType.StoredProcedure; if (com.Connection.State != ConnectionState.Open) { com.Connection.Open(); } com.Parameters.AddWithValue("num", CatID); SqlDataReader rdr = com.ExecuteReader(); if (rdr.HasRows) { liste = new List <EKATEGORI>(); while (rdr.Read()) { EKATEGORI item1 = new EKATEGORI(); item1.Name = rdr["Name"].ToString(); item1.ID = Convert.ToInt32(rdr["ID"]); liste.Add(item1); } } com.Connection.Close(); rdr.Close(); } catch { } return(liste); }
public static bool Update(EKATEGORI item) { bool sonuc = false; try { SqlCommand com = new SqlCommand("KATEGORI_Update", Baglanti.Con); com.CommandType = CommandType.StoredProcedure; if (com.Connection.State != ConnectionState.Open) { com.Connection.Open(); } com.Parameters.AddWithValue("ID", item.ID); com.Parameters.AddWithValue("ADI", item.ADI); sonuc = com.ExecuteNonQuery() > 0; } catch (Exception) { sonuc = false; } return(sonuc); }
public static int Insert(EKATEGORI item) { int etkilenen = 0; try { SqlCommand com = new SqlCommand("KATEGORI_Insert", Baglanti.Con); com.CommandType = CommandType.StoredProcedure; if (com.Connection.State != ConnectionState.Open) { com.Connection.Open(); } com.Parameters.AddWithValue("ADI", item.ADI); etkilenen = com.ExecuteNonQuery(); } catch (Exception) { etkilenen = -1; } return(etkilenen); }
}//EndOfSelect() /// <summary> /// Kategori_SelectList 'ten liste döndürdük /// </summary> /// <param name="_ID"></param> /// <returns></returns> public static List <EKATEGORI> SelectList() { List <EKATEGORI> itemList = null; try { SqlCommand com = new SqlCommand("KATEGORI_SelectList", Baglanti.Con); com.CommandType = CommandType.StoredProcedure; if (com.Connection.State != ConnectionState.Open) { com.Connection.Open(); } SqlDataReader rdr = com.ExecuteReader(); if (rdr.HasRows) { itemList = new List <EKATEGORI>(); while (rdr.Read()) { EKATEGORI item = new EKATEGORI(); item.ID = int.Parse(rdr["ID"].ToString()); item.ADI = rdr["ADI"].ToString(); itemList.Add(item); } } rdr.Close(); } catch { itemList = null; } return(itemList); } //EndOfSelectList()
}//EndOfInsert() public static bool Update(EKATEGORI item) { if (item.ID > 0 && item.ADI != null && item.ADI.Trim().Length > 0) { return(FKATEGORI.Update(item)); } return(false); }//EndOfUpdate()
public static int Insert(EKATEGORI item) { if (item.ADI != null && item.ADI.Trim().Length > 0) { return(FKATEGORI.Insert(item)); } return(-1); }//EndOfInsert()
public static bool Update(EKATEGORI item) { if (item.ID > 0 && item.ADI != null && item.ADI.Trim().Length > 0)// TRİM BOŞLKLARI KALDIRIYOR. { return(FKATEGORI.Update(item)); } return(false); }
public static int Insert(EKATEGORI item) { if (item.ADI != null && item.ADI.Trim().Length > 0)// TRİM BOŞLKLARI KALDIRIYOR. { return(FKATEGORI.Insert(item)); } return(-1); }
private void atama(int CatID) { EKATEGORI get_SubCatId = new EKATEGORI(); List <EKATEGORI> get_SubCatId2 = BLLKATEGORI.get_SubCatIdFonk(get_SubCatId, CatID); SubCategoryID1 = get_SubCatId2[0].ID; SubCategoryName1 = get_SubCatId2[0].Name; SubCategoryID2 = get_SubCatId2[1].ID; SubCategoryName2 = get_SubCatId2[1].Name; }
public static bool Update(EKATEGORI item) { bool sonuc = false; try { SqlCommand com = new SqlCommand("KATEGORI_Update", Baglanti.Con); com.CommandType = CommandType.StoredProcedure;// ınsert'ümüz sqlimizde bir storedprcedure olduğu için bunu belirttik. if (com.Connection.State != ConnectionState.Open) { com.Connection.Open(); } com.Parameters.AddWithValue("ID", item.ID); com.Parameters.AddWithValue("ADI", item.ADI); sonuc = com.ExecuteNonQuery() > 0; } catch { sonuc = false; } return(sonuc); }
public static int Insert(EKATEGORI item) { int etkilenen = 0; try { SqlCommand com = new SqlCommand("KATEGORI_Insert", Baglanti.Con); com.CommandType = CommandType.StoredProcedure;// ınsert'ümüz sqlimizde bir storedprcedure olduğu için bunu belirttik. if (com.Connection.State != ConnectionState.Open) { com.Connection.Open(); } com.Parameters.AddWithValue("ADI", item.ADI); etkilenen = com.ExecuteNonQuery(); } catch { etkilenen = -1; } return(etkilenen); }
public static List <EKATEGORI> get_SubCatIdFonk(EKATEGORI item, int CatID) { return(FKATEGORI.get_SubCatIdFonk(item, CatID)); }