public STUDENT_OBJ GetByID(STUDENT_OBJ.BusinessObjectID id) { List <STUDENT_OBJ> li = getAll(new spParam("CODE", SqlDbType.VarChar, id.CODE, 0)); if (li == null || li.Count == 0) { return(null); } return(li[0]); }
public int Delete(STUDENT_OBJ.BusinessObjectID obj) { int ret = 0; DBBase db = new DBBase(ConfigurationSettings.AppSettings["connectionString"].ToString()); string sql = @"DELETE FROM branch WHERE code=@code_key "; SqlCommand com = new SqlCommand(); com.CommandText = sql; com.CommandType = CommandType.Text; com.Parameters.Add("@code_key", SqlDbType.VarChar).Value = obj.CODE; ret = db.doCommand(ref com); return(ret); }