public static Comn_Gegree GetComn_GegreeByID(int id) { Comn_Gegree comn_Gegree = new Comn_Gegree(); SqlComn_GegreeProvider sqlComn_GegreeProvider = new SqlComn_GegreeProvider(); comn_Gegree = sqlComn_GegreeProvider.GetComn_GegreeByID(id); return(comn_Gegree); }
public int InsertComn_Gegree(Comn_Gegree comn_Gegree) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("IEB_InsertComn_Gegree", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Comn_GegreeID", SqlDbType.Int).Direction = ParameterDirection.Output; cmd.Parameters.Add("@Comn_GegreeName", SqlDbType.NVarChar).Value = comn_Gegree.Comn_GegreeName; connection.Open(); int result = cmd.ExecuteNonQuery(); return((int)cmd.Parameters["@Comn_GegreeID"].Value); } }
public bool UpdateComn_Gegree(Comn_Gegree comn_Gegree) { using (SqlConnection connection = new SqlConnection(this.ConnectionString)) { SqlCommand cmd = new SqlCommand("IEB_UpdateComn_Gegree", connection); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add("@Comn_GegreeID", SqlDbType.Int).Value = comn_Gegree.Comn_GegreeID; cmd.Parameters.Add("@Comn_GegreeName", SqlDbType.NVarChar).Value = comn_Gegree.Comn_GegreeName; connection.Open(); int result = cmd.ExecuteNonQuery(); return(result == 1); } }
public Comn_Gegree GetComn_GegreeFromReader(IDataReader reader) { try { Comn_Gegree comn_Gegree = new Comn_Gegree ( (int)reader["Comn_GegreeID"], reader["Comn_GegreeName"].ToString() ); return(comn_Gegree); } catch (Exception ex) { return(null); } }
public static bool UpdateComn_Gegree(Comn_Gegree comn_Gegree) { SqlComn_GegreeProvider sqlComn_GegreeProvider = new SqlComn_GegreeProvider(); return(sqlComn_GegreeProvider.UpdateComn_Gegree(comn_Gegree)); }
public static int InsertComn_Gegree(Comn_Gegree comn_Gegree) { SqlComn_GegreeProvider sqlComn_GegreeProvider = new SqlComn_GegreeProvider(); return(sqlComn_GegreeProvider.InsertComn_Gegree(comn_Gegree)); }