Beispiel #1
0
        public BRANCH_OBJ GetByID(BRANCH_OBJ.BusinessObjectID id)
        {
            List <BRANCH_OBJ> li = getAll(new spParam("CODE", SqlDbType.VarChar, id.CODE, 0));

            if (li == null || li.Count == 0)
            {
                return(null);
            }
            return(li[0]);
        }
Beispiel #2
0
        public int Delete(BRANCH_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);
        }